mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
btoa() takes a byte string, so it must decode the UTF-8 argument into a Vector<u8> before calling encode_base64. Likewise, in atob() decode_base64 returns a byte string, so that needs to be converted to UTF-8. With this, `btoa(String.fromCharCode(255))` is '/w==' as it should be, and `atob(btoa(String.fromCharCode(255))) == String.fromCharCode(255)` remains true.
6.2 KiB
6.2 KiB