[whatwg] Encoding: API

Anne van Kesteren annevk at annevk.nl
Thu Oct 18 01:49:57 PDT 2012

I added the API to the Encoding Standard:


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 at 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.


More information about the whatwg mailing list