mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 07:39:16 +00:00
LibJS+LibUnicode: Port Intl.ListFormat to UTF-16 strings
This commit is contained in:
parent
7d80aabbdb
commit
db2148b44a
Notes:
github-actions[bot]
2025-07-24 08:41:31 +00:00
Author: https://github.com/trflynn89
Commit: db2148b44a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5581
7 changed files with 39 additions and 33 deletions
|
@ -138,16 +138,13 @@ TimeZoneData::TimeZoneData(NonnullOwnPtr<icu::TimeZone> time_zone)
|
|||
{
|
||||
}
|
||||
|
||||
Vector<icu::UnicodeString> icu_string_list(ReadonlySpan<String> strings)
|
||||
Vector<icu::UnicodeString> icu_string_list(ReadonlySpan<Utf16String> strings)
|
||||
{
|
||||
Vector<icu::UnicodeString> result;
|
||||
result.ensure_capacity(strings.size());
|
||||
|
||||
for (auto const& string : strings) {
|
||||
auto view = string.bytes_as_string_view();
|
||||
icu::UnicodeString icu_string(view.characters_without_null_termination(), static_cast<i32>(view.length()));
|
||||
result.unchecked_append(move(icu_string));
|
||||
}
|
||||
for (auto const& string : strings)
|
||||
result.unchecked_append(icu_string(string));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue