Expand description

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::Locale;
use icu::locid::{
    extensions::unicode::Unicode,
    extensions_unicode_attribute as attribute,
    extensions_unicode_key as key, extensions_unicode_value as value,
};

let loc: Locale = "en-US-u-foobar-hc-h12".parse().expect("Parsing failed.");

assert_eq!(
    loc.extensions.unicode.keywords.get(&key!("hc")),
    Some(&value!("h12"))
);
assert!(loc
    .extensions
    .unicode
    .attributes
    .contains(&attribute!("foobar")));

Structs