W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: [XHR] responseType "json"

From: Julian Reschke <julian.reschke@gmx.de>
Date: Sat, 07 Jan 2012 15:58:43 +0100
Message-ID: <4F085DA3.4070700@gmx.de>
To: Anne van Kesteren <annevk@opera.com>
CC: public-webapps@w3.org
On 2012-01-07 15:15, Anne van Kesteren wrote:
> 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).

For text/* this is ok. For others, maybe not. It's still better than 
having to special-case each and every media type...

Best regards, Julian
Received on Saturday, 7 January 2012 14:59:17 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:49 GMT