private BaseLocale(string language, string script, string region, string variant) { if (language != null) { _language = AsciiUtil.ToLowerString(language).Intern(); } if (script != null) { _script = AsciiUtil.ToTitleString(script).Intern(); } if (region != null) { _region = AsciiUtil.ToUpperString(region).Intern(); } if (variant != null) { if (JDKIMPL) { // preserve upper/lower cases _variant = variant.Intern(); } else { _variant = AsciiUtil.ToUpperString(variant).Intern(); } } }
public static Key Normalize(Key key) { string lang = AsciiUtil.ToLowerString(key._lang).Intern(); string scrt = AsciiUtil.ToTitleString(key._scrt).Intern(); string regn = AsciiUtil.ToUpperString(key._regn).Intern(); string vart; if (JDKIMPL) { // preserve upper/lower cases vart = key._vart.Intern(); } else { vart = AsciiUtil.ToUpperString(key._vart).Intern(); } return(new Key(lang, scrt, regn, vart)); }
public static string CanonicalizeRegion(string s) { return(AsciiUtil.ToUpperString(s)); }