1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:37:45 +00:00

Meta+LibUnicode: Provide code point names through library

This commit is contained in:
Ben Wiederhake 2021-11-18 23:23:58 +01:00 committed by Andreas Kling
parent 4bd4ce439a
commit b06b54772e
4 changed files with 97 additions and 2 deletions

View file

@ -222,6 +222,18 @@ u32 to_unicode_uppercase(u32 code_point)
#endif
}
Optional<StringView> code_point_display_name([[maybe_unused]] u32 code_point)
{
#if ENABLE_UNICODE_DATA
auto name = Detail::code_point_display_name(code_point);
if (name.is_null())
return {};
return name;
#else
return {};
#endif
}
String to_unicode_lowercase_full(StringView string, [[maybe_unused]] Optional<StringView> locale)
{
#if ENABLE_UNICODE_DATA

View file

@ -19,6 +19,8 @@ namespace Unicode {
u32 to_unicode_lowercase(u32 code_point);
u32 to_unicode_uppercase(u32 code_point);
Optional<StringView> code_point_display_name(u32 code_point);
String to_unicode_lowercase_full(StringView, Optional<StringView> locale = {});
String to_unicode_uppercase_full(StringView, Optional<StringView> locale = {});