summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Bindings
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-07-22 09:56:38 -0400
committerAndreas Kling <kling@serenityos.org>2020-07-22 17:26:34 +0200
commit248b79d6872424743bfcd81ea939a6340e9d0e1a (patch)
treeeacc2e5457f13f66bf89656c5f03716df77c1181 /Libraries/LibWeb/Bindings
parent979e02c0a8b1bc63e9d825797631eb5ee5c6de6d (diff)
downloadserenity-248b79d6872424743bfcd81ea939a6340e9d0e1a.zip
LibJS: Add FIXMEs to a few functions that need UTF-16 handling
Diffstat (limited to 'Libraries/LibWeb/Bindings')
-rw-r--r--Libraries/LibWeb/Bindings/WindowObject.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Bindings/WindowObject.cpp b/Libraries/LibWeb/Bindings/WindowObject.cpp
index 98ac43dc91..9d7d4b2285 100644
--- a/Libraries/LibWeb/Bindings/WindowObject.cpp
+++ b/Libraries/LibWeb/Bindings/WindowObject.cpp
@@ -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));
}