W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2013

[whatwg] Adding a btoa overload that takes Uint8Array

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 04 Mar 2013 12:09:50 -0500
Message-ID: <5134D55E.8010503@mit.edu>
To: whatwg <whatwg@whatwg.org>
The problem I'm trying to solve is sending Unicode text to consumers who 
need base64-encoded input.  Right now the only "sane" way to do it (and 
I quote "sane" for obvious reasons) is something like the example at 
https://developer.mozilla.org/en-US/docs/DOM/window.btoa#Unicode_Strings

It seems like it would be better if the output of a TextEncoder could be 
passed directly to btoa.  But for that we need an overload of btoa that 
takes a Uint8Array.

Thoughts?

-Boris
Received on Monday, 4 March 2013 17:10:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 4 March 2013 17:10:24 GMT