Re: [XHR] responseType "json"

On Sat, 07 Jan 2012 11:30:42 +0100, Julian Reschke <julian.reschke@gmx.de>  
wrote:
> charset is undefined on application/json, so ignoring it is the right  
> thing.
>
> text/event-stream;charset=hz-gb-2312 on the other hand is invalid (as  
> far as I understand the spec), so if this defaults to UTF-8 this is just  
> an effect of the specified error handling.

I guess so. FWIW, the theory that 'charset' is defined for certain media  
types and not for others is not necessarily implemented that way. E.g.  
XMLHttpRequest text decoding just searches for a 'charset' parameter  
regardless of what the media type is. Not sure if that is the only context  
in which implementations diverge from the theoretical model (the  
theoretical model is kind of impossible to work with for generic code).


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

Received on Saturday, 7 January 2012 14:18:32 UTC