mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 19:19:44 +03:00
LibUnicode: Canonicalize locale private use extensions
This commit is contained in:
parent
6f0cb52dc4
commit
f897c2edb3
Notes:
sideshowbarker
2024-07-18 05:04:21 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/f897c2edb3d Pull-request: https://github.com/SerenityOS/serenity/pull/9668 Reviewed-by: https://github.com/linusg
@ -323,8 +323,15 @@ TEST_CASE(canonicalize_unicode_locale_id)
|
||||
test("en-z-bbb-0-aaa"sv, "en-0-aaa-z-bbb"sv);
|
||||
test("EN-Z-BBB-0-AAA"sv, "en-0-aaa-z-bbb"sv);
|
||||
|
||||
test("en-x-aa"sv, "en-x-aa"sv);
|
||||
test("EN-X-AA"sv, "en-x-aa"sv);
|
||||
test("en-x-bbb-aa"sv, "en-x-bbb-aa"sv);
|
||||
test("EN-X-BBB-AA"sv, "en-x-bbb-aa"sv);
|
||||
|
||||
test("en-u-aa-t-en"sv, "en-t-en-u-aa"sv);
|
||||
test("EN-U-AA-T-EN"sv, "en-t-en-u-aa"sv);
|
||||
test("en-z-bbb-u-aa-t-en-0-aaa"sv, "en-0-aaa-t-en-u-aa-z-bbb"sv);
|
||||
test("EN-Z-BBB-U-AA-T-EN-0-AAA"sv, "en-0-aaa-t-en-u-aa-z-bbb"sv);
|
||||
test("en-z-bbb-u-aa-t-en-0-aaa-x-ccc"sv, "en-0-aaa-t-en-u-aa-z-bbb-x-ccc"sv);
|
||||
test("EN-Z-BBB-U-AA-T-EN-0-AAA-X-CCC"sv, "en-0-aaa-t-en-u-aa-z-bbb-x-ccc"sv);
|
||||
}
|
||||
|
@ -580,7 +580,11 @@ Optional<String> canonicalize_unicode_locale_id(LocaleID& locale_id)
|
||||
});
|
||||
}
|
||||
|
||||
// FIXME: Handle pu_extensions.
|
||||
if (!locale_id.private_use_extensions.is_empty()) {
|
||||
builder.append("-x"sv);
|
||||
for (auto const& extension : locale_id.private_use_extensions)
|
||||
append_sep_and_string(extension);
|
||||
}
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user