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

Re: [whatwg] Encoding: API

From: Anne van Kesteren <annevk@annevk.nl>
Date: Thu, 18 Oct 2012 10:49:57 +0200
Message-ID: <CADnb78i+ggj3rFLAv3s0pVT23sD1MLKO331xJjk_oHnPJKhNMg@mail.gmail.com>
To: Joshua Bell <jsbell@chromium.org>
Cc: WHATWG <whatwg@whatwg.org>
I added the API to the Encoding Standard:

  http://encoding.spec.whatwg.org/#api

Feedback welcome. I suppose we might want to write an introduction for it too.


On Thu, Oct 11, 2012 at 6:37 PM, Joshua Bell <jsbell@chromium.org> wrote:
> It sounds like there are several desirable behaviors:
>
> 1. ignore BOM handling entirely (BOM would be present in output, or fatal)
> 2. if matching BOM, consume; otherwise, ignore (mismatching BOM would be
> present in output, or fatal)
> 3. switch encoding based on BOM (any of UTF-8, UTF-16LE, UTF-16BE)
> 4. switch encoding based on BOM if-and-only-if "UTF-16" explicitly
> specified, and only to one of the UTF-16 variants

I went with supporting just 2 for now. 4 seems weird.


>> The behavior of the normal decode algorithm does not need to be
>> exposed through the API I think, unless a use case comes up at some
>> point.
>
> That would be equivalent to #3, correct?

Yes, HTML, CSS, etc. do #3.


-- 
http://annevankesteren.nl/
Received on Thursday, 18 October 2012 08:50:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT