mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
LibUnicode+LibJS: Store locale keyword values as a single string
Previously, LibUnicode would store the values of a keyword as a Vector. For example, the locale "en-u-ca-abc-def" would have its keyword "ca" stored as {"abc, "def"}. Then, canonicalization would occur on each of the elements in that Vector. This is incorrect because, for example, the keyword value "true" should only be dropped if that is the entire value. That is, the canonical form of "en-u-kb-true" is "en-u-kb", but "en-u-kb-abc-true" does not change for canonicalization. However, we would canonicalize that locale as "en-u-kb-abc".
This commit is contained in:
parent
75657b79c6
commit
4f2bcebe74
5 changed files with 102 additions and 118 deletions
|
@ -29,7 +29,7 @@ struct LanguageID {
|
|||
|
||||
struct Keyword {
|
||||
String key {};
|
||||
Vector<String> types {};
|
||||
String value {};
|
||||
};
|
||||
|
||||
struct LocaleExtension {
|
||||
|
@ -38,8 +38,8 @@ struct LocaleExtension {
|
|||
};
|
||||
|
||||
struct TransformedField {
|
||||
String key;
|
||||
Vector<String> values {};
|
||||
String key {};
|
||||
String value {};
|
||||
};
|
||||
|
||||
struct TransformedExtension {
|
||||
|
@ -49,7 +49,7 @@ struct TransformedExtension {
|
|||
|
||||
struct OtherExtension {
|
||||
char key {};
|
||||
Vector<String> values {};
|
||||
String value {};
|
||||
};
|
||||
|
||||
using Extension = Variant<LocaleExtension, TransformedExtension, OtherExtension>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue