mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-05 05:25:34 +00:00
ICU-22765 fix uloc_addLikelySubtags on "und@x=private"
This commit is contained in:
parent
ca9fcca3c7
commit
1dcb4bcb2d
4 changed files with 26 additions and 2 deletions
|
@ -527,7 +527,7 @@ LSR LikelySubtags::makeMaximizedLsrFrom(const Locale &locale,
|
|||
return {};
|
||||
}
|
||||
const char *name = locale.getName();
|
||||
if (uprv_isAtSign(name[0]) && name[1] == 'x' && name[2] == '=') { // name.startsWith("@x=")
|
||||
if (!returnInputIfUnmatch && uprv_isAtSign(name[0]) && name[1] == 'x' && name[2] == '=') { // name.startsWith("@x=")
|
||||
// Private use language tag x-subtag-subtag... which CLDR changes to
|
||||
// und-x-subtag-subtag...
|
||||
return LSR(name, "", "", LSR::EXPLICIT_LSR);
|
||||
|
|
|
@ -3924,6 +3924,13 @@ const char* const basic_maximize_data[][2] = {
|
|||
// ICU-22545 & ICU-22742
|
||||
"ru_XC",
|
||||
"ru_Cyrl_XC"
|
||||
}, {
|
||||
// ICU-22765
|
||||
"und@x=private",
|
||||
"en_Latn_US@x=private",
|
||||
}, {
|
||||
"th@x=private",
|
||||
"th_Thai_TH@x=private",
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -4124,6 +4124,15 @@ LocaleTest::TestAddLikelyAndMinimizeSubtags() {
|
|||
"en_PSCRACK",
|
||||
"en_Latn_US_PSCRACK",
|
||||
"en__PSCRACK"
|
||||
}, {
|
||||
// ICU-22765
|
||||
"th@x=private",
|
||||
"th_Thai_TH@x=private",
|
||||
"th@x=private",
|
||||
}, {
|
||||
"und@x=private",
|
||||
"en_Latn_US@x=private",
|
||||
"en@x=private",
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -4162,7 +4162,15 @@ public class ULocaleTest extends CoreTestFmwk {
|
|||
"und_US",
|
||||
"en_Latn_US",
|
||||
"en"
|
||||
}
|
||||
}, {
|
||||
"th@x=private",
|
||||
"th_Thai_TH@x=private",
|
||||
"th@x=private",
|
||||
}, {
|
||||
"und@x=private",
|
||||
"en_Latn_US@x=private",
|
||||
"en@x=private",
|
||||
}
|
||||
};
|
||||
|
||||
for (int i = 0; i < full_data.length; i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue