mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:07:34 +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:
parent
1edb96376b
commit
d793262beb
10 changed files with 25 additions and 22 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <AK/Types.h>
|
||||
#include <AK/Utf16View.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
|
||||
namespace JS {
|
||||
namespace Detail {
|
||||
|
@ -49,7 +50,7 @@ public:
|
|||
Utf16View substring_view(size_t code_unit_offset, size_t code_unit_length) const;
|
||||
Utf16View substring_view(size_t code_unit_offset) const;
|
||||
|
||||
DeprecatedString to_utf8() const;
|
||||
ThrowCompletionOr<DeprecatedString> to_utf8(VM&) const;
|
||||
u16 code_unit_at(size_t index) const;
|
||||
|
||||
size_t length_in_code_units() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue