

Base64 encodes bytes, not text
btoa('ñ') gives the wrong answer and btoa('😀') throws. Base64 works on bytes, so text has to become bytes first. How my Base64 tool does it, and how it tells bad input from binary data.
1 post with this tag.


btoa('ñ') gives the wrong answer and btoa('😀') throws. Base64 works on bytes, so text has to become bytes first. How my Base64 tool does it, and how it tells bad input from binary data.