W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2012

Re: [whatwg] StringEncoding open issues

From: Glenn Maynard <glenn@zewt.org>
Date: Fri, 17 Aug 2012 09:15:50 -0500
Message-ID: <CABirCh8QE5xt0XRhv_dHSDPMy4sbofSatnnSwK+Kd=QCKJ41bA@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: WHAT Working Group <whatwg@lists.whatwg.org>, Joshua Bell <jsbell@chromium.org>
On Fri, Aug 17, 2012 at 2:23 AM, Jonas Sicking <jonas@sicking.cc> wrote:

> >       - If encoding is "utf-16" and the first bytes match 0xFF 0xFE or
> 0xFE
> >       0xFF then set current encoding to "utf-16" or "utf-16be"
> respectively and
> >       advance the stream past the BOM. The current encoding is used
> until the
> >       stream is reset.
> >       - Otherwise, if the first bytes match 0xFF 0xFE, 0xFE 0xFF, or 0xEF
> >       0xBB 0xBF then set current encoding to "utf-16", "utf-16be" or
> "utf-8"
> >       respectively and advance the stream past the BOM. The current
> encoding is
> >       used until the stream is reset.
>
> This doesn't sound right. The effect of the rules so far would be that
> if you create a decoder and specify "utf-16" as encoding, and the
> first bytes in the stream are 0xEF 0xBB 0xBF you'd silently switch to
> "utf-8" decoding.
>

I think the scope of the "otherwise" is unclear, and this is meant to be
"otherwise (if encoding is not "utf-16")".

-- 
Glenn Maynard
Received on Friday, 17 August 2012 14:16:20 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:44 UTC