[whatwg] API for encoding/decoding ArrayBuffers into text

Anne van Kesteren annevk at opera.com
Thu Mar 22 02:19:30 PDT 2012


On Wed, 21 Mar 2012 16:53:36 +0100, Joshua Bell <jsbell at chromium.org>  
wrote:
> Just to throw it out there - does anyone feel we can/should offer
> asymmetric encode/decode support, i.e. supporting more encodings for  
> decode operations than for encode operations?

XMLHttpRequest has that. You can only send (encode) UTF-8, receive  
(decode) "everything". Forms can send "everything". URL query parameters  
can encode everything (though the page itself has to be encoded in the  
encoding of choice).

If we have no use cases just supporting encoding UTF-8 seems fine to me,  
but I think the design should allow for other encodings in the future.


> Bikeshedding on the name - we'd have to put "String" or "Text" in there
> somewhere, since audio/video/image codecs will likely want to use similar
> terms.

They can use the prefixed variants :-) If we have to use a prefix "String"  
seems better, as Text is a node object in the platform.


-- 
Anne van Kesteren
http://annevankesteren.nl/



More information about the whatwg mailing list