Skip to content

Commit 7a22759

Browse files
authored
Force Latin alphabet for Montenegro (#4849)
This fix forces Latin alphabet for Montenegro (Montenegro only use Latin character set). Without this fix the Montenegro Serbian, for example, displaying Serbian Cyrillic. Can't do this in the lower code inside uloc_getCountry() because uloc_getCountry is a thirdparty library code. b/370816783
1 parent 7795604 commit 7a22759

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cobalt/base/language.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ std::string GetSystemLanguage() {
3737
std::string language = buffer;
3838
uloc_getCountry(NULL, buffer, arraysize(buffer), &icu_result);
3939
if (U_SUCCESS(icu_result) && buffer[0]) {
40+
// Montenegro uses the Latin alphabet.
41+
// Needs to be forced, as not all platforms know it.
42+
assert (sizeof(buffer) > 7); // sizeof("Latn-ME")
43+
if (strcmp(buffer, "ME") == 0)
44+
strncpy(buffer, "Latn-ME", sizeof(buffer));
4045
language += "-";
4146
language += buffer;
4247
}

0 commit comments

Comments
 (0)