Module icu_locid::extensions::unicode [−][src]
Unicode Extensions provide information about user preferences in a given locale.
The main struct for this extension is Unicode
which contains Keywords
and
Attributes
.
Examples
use icu::locid::{LanguageIdentifier, Locale}; use icu::locid::extensions::unicode::{Unicode, Key, Value, Attribute}; let mut loc: Locale = "en-US-u-foobar-hc-h12".parse() .expect("Parsing failed."); let key: Key = "hc".parse() .expect("Parsing key failed."); let value: Value = "h12".parse() .expect("Parsing value failed."); let attribute: Attribute = "foobar".parse() .expect("Parsing attribute failed."); assert_eq!(loc.extensions.unicode.keywords.get(&key), Some(&value)); assert!(loc.extensions.unicode.attributes.contains(&attribute)); assert_eq!(&loc.extensions.unicode.to_string(), "-u-foobar-hc-h12");
Structs
Attribute | An attribute used in a set of |
Attributes | A set of |
Key | A key used in a list of |
Keywords | A list of |
Unicode | Unicode Extensions provide information about user preferences in a given locale. |
Value | A value used in a list of |