LibUnicode: Parse and generate time zone names in long and short form

This commit is contained in:
Timothy Flynn 2021-12-06 15:46:49 -05:00 committed by Linus Groh
parent 2bbf8aa24c
commit b76e44f66f
Notes: sideshowbarker 2024-07-17 23:05:10 +09:00
4 changed files with 208 additions and 2 deletions

View file

@ -302,7 +302,7 @@ template<typename LocalesType, typename ListFormatter>
void generate_mapping(SourceGenerator& generator, LocalesType const& locales, StringView type, StringView name, StringView format, ListFormatter&& format_list)
{
auto format_mapping_name = [](StringView format, StringView name) {
auto mapping_name = name.to_lowercase_string().replace("-"sv, "_"sv, true);
auto mapping_name = name.to_lowercase_string().replace("-"sv, "_"sv, true).replace("/"sv, "_"sv, true);
return String::formatted(format, mapping_name);
};