summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Bindings/WindowObject.cpp
diff options
context:
space:
mode:
authorLuke <luke.wilde@live.co.uk>2020-11-13 11:16:28 +0000
committerAndreas Kling <kling@serenityos.org>2020-11-14 10:14:03 +0100
commited2689c00a08dbed5deac559e5b77d61792c720c (patch)
tree59b0f4e0cd160585ce2cd7917b1c722110926cff /Libraries/LibWeb/Bindings/WindowObject.cpp
parentf3d2053bff829be79f6ee8ffc6e85b5bebdb8715 (diff)
downloadserenity-ed2689c00a08dbed5deac559e5b77d61792c720c.zip
LibWeb: Use standardized encoding names, add encoding attribute to document
Diffstat (limited to 'Libraries/LibWeb/Bindings/WindowObject.cpp')
-rw-r--r--Libraries/LibWeb/Bindings/WindowObject.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Bindings/WindowObject.cpp b/Libraries/LibWeb/Bindings/WindowObject.cpp
index 26b6ba1311..44f424c6ec 100644
--- a/Libraries/LibWeb/Bindings/WindowObject.cpp
+++ b/Libraries/LibWeb/Bindings/WindowObject.cpp
@@ -283,7 +283,9 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::atob)
auto decoded = decode_base64(StringView(string));
// decode_base64() returns a byte string. LibJS uses UTF-8 for strings. Use Latin1Decoder to convert bytes 128-255 to UTF-8.
- return JS::js_string(vm, TextCodec::decoder_for("iso-8859-1")->to_utf8(decoded));
+ auto decoder = TextCodec::decoder_for("windows-1252");
+ ASSERT(decoder);
+ return JS::js_string(vm, decoder->to_utf8(decoded));
}
JS_DEFINE_NATIVE_FUNCTION(WindowObject::btoa)