aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-02 20:17:25 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-02 20:17:25 -0700
commit3a0a423bcec850ea1a138f161012b0c622ccee28 (patch)
tree3c2b60b92d934f08e4bb1cc892959ab4ed6346df
parenteb90ce50c362149829590dc78db4d4d73fb2b36e (diff)
downloadbun-3a0a423bcec850ea1a138f161012b0c622ccee28.tar.gz
bun-3a0a423bcec850ea1a138f161012b0c622ccee28.tar.zst
bun-3a0a423bcec850ea1a138f161012b0c622ccee28.zip
Add comment
-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();