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

Re: [XHR] responseType "json"

From: Glenn Maynard <glenn@zewt.org>
Date: Fri, 6 Jan 2012 20:10:16 -0500
Message-ID: <CABirCh--oPeYJvCkwfrgSrT3PXfjbZx9Qdd0ogaVWg+gz6st8g@mail.gmail.com>
To: Jarred Nicholls <jarred@webkit.org>
Cc: "Web Applications Working Group WG (public-webapps@w3.org)" <public-webapps@w3.org>, Anne van Kesteren <annevk@opera.com>
On Fri, Jan 6, 2012 at 7:36 PM, Jarred Nicholls <jarred@webkit.org> wrote:
> Correction: rfc4627 doesn't describe BOM detection, it describes zero-byte
> detection.  My question remains, though: what exactly are you doing?  Do
> you do zero-byte detection?  Do you do BOM detection?  What's the order of
> precedence between zero-byte and/or BOM detection, HTTP Content-Type
> headers, and overrideMimeType if they disagree?  All of this would need to
> be specified; currently none of it is.
> None of that matters if a specific codec is the one all be all.  If that's
> the consensus then that's it, period.
> WebKit shares a single text decoder globally for HTML, XML, plain text,
> etc. the XHR payload runs through it before it would pass to JSON.parse.
>  Read the code if you're interested.  I would need to change the text
> decoder to skip BOM detection for this one case unless the spec added that
> wording of discarding when encoding != UTF-8, then that can be enforced all
> in XHR with no decoder changes.  I don't want to get hung on explaining
> WebKit's specific impl. details.

All of the details I asked about are user-visible, not WebKit
implementation details, and would need to be specified if encodings other
than UTF-8 were allowed.  I do think this should remain UTF-8 only, but if
you want to discuss allowing other encodings, these are things that would
need to be defined (which requires a clear proposal, not "read the code").

I assume it's not using the exact same decoder logic as HTML.  After all,
that would allow non-Unicode encodings.

Glenn Maynard
Received on Saturday, 7 January 2012 01:10:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:30 UTC