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

AK+Everywhere: Make UTF-16 to UTF-8 converter fallible

This could fail to allocate the underlying storage needed to store the
UTF-8 data. Propagate this error.
This commit is contained in:
Timothy Flynn 2023-01-07 13:59:10 -05:00 committed by Linus Groh
parent 1edb96376b
commit d793262beb
10 changed files with 25 additions and 22 deletions

View file

@ -385,7 +385,7 @@ public:
{
return m_view.visit(
[](StringView view) { return view.to_deprecated_string(); },
[](Utf16View view) { return view.to_utf8(Utf16View::AllowInvalidCodeUnits::Yes); },
[](Utf16View view) { return view.to_utf8(Utf16View::AllowInvalidCodeUnits::Yes).release_value_but_fixme_should_propagate_errors(); },
[](auto& view) {
StringBuilder builder;
for (auto it = view.begin(); it != view.end(); ++it)