mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 03:57:15 +02:00
LibJS: Compare Unicode locale variants using case-insensitive matching
In the IsStructurallyValidLanguageTag AO, we of course cannot assume the variants are canonicalized to lower-case yet, because canonicalization hasn't happened yet.
This commit is contained in:
committed by
Linus Groh
parent
fdedb3ab33
commit
940c023e09
Notes:
sideshowbarker
2024-07-18 04:53:26 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/940c023e09f Pull-request: https://github.com/SerenityOS/serenity/pull/9749 Reviewed-by: https://github.com/linusg ✅
@@ -26,7 +26,7 @@ static Optional<Unicode::LocaleID> is_structurally_valid_language_tag(StringView
|
||||
quick_sort(variants);
|
||||
|
||||
for (size_t i = 0; i < variants.size() - 1; ++i) {
|
||||
if (variants[i] == variants[i + 1])
|
||||
if (variants[i].equals_ignoring_case(variants[i + 1]))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user