1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 19:34:59 +00:00

LibUnicode: Parse numbers in number formats a bit more leniently

The parser was previously expecting number sections within a pattern to
start with "#", but they may also begin with "0".
This commit is contained in:
Timothy Flynn 2021-11-12 15:49:14 -05:00 committed by Linus Groh
parent f88b4dfb58
commit 6cfd63e5bd

View file

@ -90,7 +90,7 @@ static void parse_number_pattern(String pattern, UnicodeLocaleData& locale_data,
{ "¤"sv, "{currencyCode}"sv }, // U+00A4 Currency Sign
};
if (auto start_number_index = pattern.find('#'); start_number_index.has_value()) {
if (auto start_number_index = pattern.find_any_of("#0"sv, String::SearchDirection::Forward); start_number_index.has_value()) {
auto end_number_index = *start_number_index + 1;
for (; end_number_index < pattern.length(); ++end_number_index) {