t->language = T_CString_toLowerCase(pSubtag);
pLastGoodPosition = pSep;
- next = EXTL | SCRT | REGN | VART | EXTS | PRIV;
+ next = SCRT | REGN | VART | EXTS | PRIV;
+ if (subtagLen <= 3)
+ next |= EXTL;
continue;
}
}
}
}
if (next & PRIV) {
- if (uprv_tolower(*pSubtag) == PRIVATEUSE) {
+ if (uprv_tolower(*pSubtag) == PRIVATEUSE && subtagLen == 1) {
char *pPrivuseVal;
if (pExtension != NULL) {
{"und-Latn-DE-u-em-emoji", "_Latn_DE@em=emoji", FULL_LENGTH},
{"und-Zzzz-DE-u-em-emoji", "_Zzzz_DE@em=emoji", FULL_LENGTH},
{"und-DE-u-em-emoji", "_DE@em=emoji", FULL_LENGTH},
+ // #20098
+ {"hant-cmn-cn", "hant", 4},
+ {"zh-cmn-TW", "cmn_TW", FULL_LENGTH},
+ {"zh-x_t-ab", "zh", 2},
+ {"zh-hans-cn-u-ca-x_t-u", "zh_Hans_CN@calendar=yes", 15},
{NULL, NULL, 0}
};
// langtag must start with either language or privateuse
if (tag.parseLanguage(itr, sts)) {
- tag.parseExtlangs(itr, sts);
+ // ExtLang can only be preceded by 2-3 letter language subtag.
+ if (tag._language.length() <= 3)
+ tag.parseExtlangs(itr, sts);
tag.parseScript(itr, sts);
tag.parseRegion(itr, sts);
tag.parseVariants(itr, sts);
{"en-u-baz-ca-islamic-civil", "en@attribute=baz;calendar=islamic-civil", NOERROR},
{"en-a-bar-u-ca-islamic-civil-x-u-foo", "en@a=bar;calendar=islamic-civil;x=u-foo", NOERROR},
{"en-a-bar-u-baz-ca-islamic-civil-x-u-foo", "en@a=bar;attribute=baz;calendar=islamic-civil;x=u-foo", NOERROR},
-
+ /* #20098 */
+ {"hant-cmn-cn", "hant", Integer.valueOf(5)},
+ {"zh-cmn-TW", "cmn_TW", NOERROR},
+ {"zh-x_t-ab", "zh", Integer.valueOf(3)},
+ {"zh-hans-cn-u-ca-x_t-u", "zh_Hans_CN@calendar=yes", Integer.valueOf(16)},
};
for (int i = 0; i < langtag_to_locale.length; i++) {