LibJS+LibUnicode: Port Intl.DateTimeFormat to UTF-16 strings

This commit is contained in:
Timothy Flynn 2025-07-23 14:24:25 -04:00 committed by Andreas Kling
commit ee01f857d1
Notes: github-actions[bot] 2025-07-24 08:41:42 +00:00
6 changed files with 26 additions and 18 deletions

View file

@ -162,6 +162,11 @@ String icu_string_to_string(UChar const* string, i32 length)
return MUST(Utf16View { string, static_cast<size_t>(length) }.to_utf8());
}
Utf16String icu_string_to_utf16_string(icu::UnicodeString const& string)
{
return Utf16String::from_utf16_without_validation({ string.getBuffer(), static_cast<size_t>(string.length()) });
}
UCharIterator icu_string_iterator(Utf16View const& string)
{
UCharIterator iterator;