1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

LibUnicode: Parse number system digits from the CLDR

We had a hard-coded table of number system digits copied from ECMA-402.
Turns out these digits are in the CLDR, so let's parse the digits from
there instead of hard-coding them.
This commit is contained in:
Timothy Flynn 2022-01-11 18:42:07 -05:00 committed by Linus Groh
parent 05ed8d1738
commit c5138f0f2b
5 changed files with 112 additions and 86 deletions

View file

@ -65,10 +65,13 @@ enum class NumericSymbol : u8 {
PlusSign,
};
Optional<NumberSystem> number_system_from_string(StringView system);
Optional<StringView> get_default_number_system(StringView locale);
Optional<StringView> get_number_system_symbol(StringView locale, StringView system, NumericSymbol symbol);
Optional<NumberGroupings> get_number_system_groupings(StringView locale, StringView system);
Optional<Span<u32 const>> get_digits_for_number_system(StringView system);
String replace_digits_for_number_system(StringView system, StringView number);
Optional<NumberFormat> get_standard_number_system_format(StringView locale, StringView system, StandardNumberFormatType type);