mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
LibTextCodec+Everywhere: Return Optional<Decoder&> from decoder_for()
This commit is contained in:
committed by
Andreas Kling
parent
2f4c463920
commit
f2a9426885
@@ -1420,7 +1420,7 @@ JS_DEFINE_NATIVE_FUNCTION(Window::atob)
|
||||
// The bytes object might contain bytes greater than 128, encode them in UTF8
|
||||
// NOTE: Any 8-bit encoding -> utf-8 decoder will work for this
|
||||
auto text_decoder = TextCodec::decoder_for("windows-1252"sv);
|
||||
VERIFY(text_decoder);
|
||||
VERIFY(text_decoder.has_value());
|
||||
auto text = text_decoder->to_utf8(decoded.release_value());
|
||||
|
||||
return JS::PrimitiveString::create(vm, DeprecatedString(text));
|
||||
|
||||
Reference in New Issue
Block a user