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

AK: Add Utf16View::to_utf8 to convert the view to a UTF-8 AK::String

This commit is contained in:
Timothy Flynn 2023-01-08 18:56:53 -05:00 committed by Linus Groh
parent d0403ec14f
commit 2eacc7aec1
3 changed files with 17 additions and 10 deletions

View file

@ -12,6 +12,7 @@
#include <AK/Forward.h>
#include <AK/Optional.h>
#include <AK/Span.h>
#include <AK/String.h>
#include <AK/Types.h>
#include <AK/Vector.h>
@ -76,6 +77,7 @@ public:
};
ErrorOr<DeprecatedString> to_deprecated_string(AllowInvalidCodeUnits = AllowInvalidCodeUnits::No) const;
ErrorOr<String> to_utf8(AllowInvalidCodeUnits = AllowInvalidCodeUnits::No) const;
bool is_null() const { return m_code_units.is_null(); }
bool is_empty() const { return m_code_units.is_empty(); }