LibTextCodec+Everywhere: Port Decoders to new Strings

This commit is contained in:
Sam Atkins 2023-02-17 20:15:10 +00:00 committed by Andreas Kling
commit 2db168acc1
Notes: sideshowbarker 2024-07-17 00:00:59 +09:00
21 changed files with 149 additions and 123 deletions

View file

@ -1421,9 +1421,9 @@ JS_DEFINE_NATIVE_FUNCTION(Window::atob)
// NOTE: Any 8-bit encoding -> utf-8 decoder will work for this
auto text_decoder = TextCodec::decoder_for("windows-1252"sv);
VERIFY(text_decoder.has_value());
auto text = text_decoder->to_utf8(decoded.release_value());
auto text = TRY_OR_THROW_OOM(vm, text_decoder->to_utf8(decoded.release_value()));
return JS::PrimitiveString::create(vm, DeprecatedString(text));
return JS::PrimitiveString::create(vm, text);
}
JS_DEFINE_NATIVE_FUNCTION(Window::btoa)