aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp
index 102e5e4e8..b69a4ebb3 100644
--- a/src/bun.js/bindings/ZigGlobalObject.cpp
+++ b/src/bun.js/bindings/ZigGlobalObject.cpp
@@ -1204,6 +1204,10 @@ JSC_DEFINE_HOST_FUNCTION(functionBTOA,
return JSC::JSValue::encode(JSC::JSValue {});
}
+ // Reminder: btoa() is for Byte Strings
+ // Specifically: latin1 byte strings
+ // That means even though this looks like the wrong thing to do,
+ // we should be converting to latin1, not utf8.
if (!encodedString.is8Bit()) {
LChar* ptr;
unsigned length = encodedString.length();