Skip to content

Commit f8a655d

Browse files
committed
Bug 1618034 - Strip private subtags in nsLanguageAtomService::GetUncachedLanguageGroup so that we can parse the standard subtags and use the proper font prefs. r=zbraniecki
Differential Revision: https://phabricator.services.mozilla.com/D72050 UltraBlame original commit: 961700e5d48a292ca8d15f974729946227374359
1 parent 24c7db5 commit f8a655d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

intl/locale/nsLanguageAtomService.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,18 @@ nsStaticAtom* nsLanguageAtomService::GetUncachedLanguageGroup(
171171
}
172172
} else {
173173

174+
175+
176+
177+
178+
nsACString::const_iterator start, end;
179+
langStr.BeginReading(start);
180+
langStr.EndReading(end);
181+
if (FindInReadable(NS_LITERAL_CSTRING("-x-"), start, end)) {
182+
183+
langStr.Truncate(start.get() - langStr.BeginReading());
184+
}
185+
174186
Locale loc(langStr);
175187
if (loc.IsWellFormed()) {
176188

0 commit comments

Comments
 (0)