mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:48:12 +00:00
LibJS: Add FIXMEs to a few functions that need UTF-16 handling
This commit is contained in:
parent
979e02c0a8
commit
248b79d687
2 changed files with 8 additions and 1 deletions
|
@ -251,6 +251,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::atob)
|
|||
auto string = interpreter.argument(0).to_string(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
// FIXME: This should convert string from a byte string to LibJS's internal string encoding (UTF-8).
|
||||
auto decoded = decode_base64(StringView(string));
|
||||
return JS::js_string(interpreter, String::copy(decoded));
|
||||
}
|
||||
|
@ -265,6 +266,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::btoa)
|
|||
auto string = interpreter.argument(0).to_string(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
// FIXME: This should convert string to a non-UTF-8 byte string first.
|
||||
auto encoded = encode_base64(StringView(string));
|
||||
return JS::js_string(interpreter, String::copy(encoded));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue