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

Re: [whatwg] Encoding: API

From: Glenn Maynard <glenn@zewt.org>
Date: Thu, 18 Oct 2012 09:16:52 -0500
Message-ID: <CABirCh9ykN5n3YyciXFxXeq8zt+YRwyOdGtz24hSZSM7gkcT7g@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: WHATWG <whatwg@whatwg.org>, Joshua Bell <jsbell@chromium.org>
On Thu, Oct 18, 2012 at 3:54 AM, Anne van Kesteren <annevk@annevk.nl> wrote:

> On Thu, Oct 18, 2012 at 10:49 AM, Anne van Kesteren <annevk@annevk.nl>
> wrote:
> >   http://encoding.spec.whatwg.org/#api
>
> Btw, I changed these things:
>
> * TextDecoder.decode()'s view argument is no longer optional. Why should
> it be?
>

It buffers the "EOF byte" when in streaming mode, eg. when the last byte of
the stream is a UTF-8 continuation byte, so any encode errors are triggered.

* TextEncoder.encode()'s input argument is no longer nullable. Again,
> why should it be?
>

Likewise for encoding, to flush errors for trailing high surrogates.

I also raised the issue of whether TextEncoder should really support
> utf-16/utf-16be as the encoding standard tries to deprecate non-utf-8
> encodings.
>

The whole point of this API is to support legacy file formats that use
other encodings.  (It's probably questionable to not support other
encodings, too, eg. filenames in ZIP file headers, but starting out with
Unicode is fine.)

-- 
Glenn Maynard
Received on Thursday, 18 October 2012 14:17:28 GMT

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