Skip to content

Commit

Permalink
classlib: fix toLowerCase/toUpperCase on Locale.ROOT (konsolety…
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidDev authored and miviwi committed Aug 1, 2024
1 parent c91acc1 commit 627809e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public String toString() {

public TString toLanguageTag() {
StringBuilder result = new StringBuilder();
result.append(languageCode);
result.append(languageCode.isEmpty() ? "und" : languageCode);
if (!countryCode.isEmpty()) {
result.append('-');
result.append(countryCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ public void convertsCaseLocaled() {
assertEquals("İSTANBUL", turkish.toUpperCase(new Locale("tr", "TR")));
assertNotEquals(common.toUpperCase(Locale.US), turkish.toUpperCase(new Locale("tr", "TR")));
assertEquals(common.toUpperCase(Locale.US), common.toUpperCase(Locale.CANADA));
assertEquals(common.toUpperCase(Locale.US), common.toUpperCase(Locale.ROOT));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@ public void testLanguageTag() {
assertEquals("zh-CN", Locale.SIMPLIFIED_CHINESE.toLanguageTag());
assertEquals("en-GB", Locale.UK.toLanguageTag());
assertEquals("en-US", Locale.US.toLanguageTag());
assertEquals("und", Locale.ROOT.toLanguageTag());
}
}

0 comments on commit 627809e

Please sign in to comment.