mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
LibTextCodec+Everywhere: Return Optional<Decoder&> from decoder_for()
This commit is contained in:
committed by
Andreas Kling
parent
2f4c463920
commit
f2a9426885
@@ -161,8 +161,8 @@ WebIDL::ExceptionOr<DeprecatedString> WorkerGlobalScope::atob(DeprecatedString c
|
||||
|
||||
// 3. Return decodedData.
|
||||
// decode_base64() returns a byte string. LibJS uses UTF-8 for strings. Use Latin1Decoder to convert bytes 128-255 to UTF-8.
|
||||
auto* decoder = TextCodec::decoder_for("windows-1252"sv);
|
||||
VERIFY(decoder);
|
||||
auto decoder = TextCodec::decoder_for("windows-1252"sv);
|
||||
VERIFY(decoder.has_value());
|
||||
return decoder->to_utf8(decoded_data.value());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user