Native base64 utility methods

Mathias Bynens mathias at
Mon May 5 00:54:52 PDT 2014

On 5 May 2014, at 00:00, Andrea Giammarchi <andrea.giammarchi at> wrote:

> as generic global utility it would be also nice to make it compatible with all strings.

For backwards compatibility reasons, `atob`/`btoa` should probably continue to work in exactly the same way they work now (i.e as per Otherwise, any existing code that uses `atob`/`btoa` before UTF-8-decoding or after UTF-8-encoding, including your snippet, would suddenly break.

Like you demonstrated, it’s easy enough to encode or decode the input using UTF-8 or any other character encoding before passing to `atob`/`btoa`. (E.g.

More information about the es-discuss mailing list