W3C home > Mailing lists > Public > www-international@w3.org > April to June 2009

RE: Auto-detect and encodings in HTML5

From: Phillips, Addison <addison@amazon.com>
Date: Mon, 1 Jun 2009 18:08:34 -0700
To: "M.T. Carrasco Benitez" <mtcarrascob@yahoo.com>, Anne van Kesteren <annevk@opera.com>, Chris Wilson <Chris.Wilson@microsoft.com>, Maciej Stachowiak <mjs@apple.com>, Larry Masinter <masinter@adobe.com>
CC: Travis Leithead <Travis.Leithead@microsoft.com>, Erik van der Poel <erikv@google.com>, "public-html@w3.org" <public-html@w3.org>, "www-international@w3.org" <www-international@w3.org>, Richard Ishida <ishida@w3.org>, Ian Hickson <ian@hixie.ch>, Harley Rosnow <Harley.Rosnow@microsoft.com>
Message-ID: <4D25F22093241741BC1D0EEBC2DBB1DA01A0EBE1B1@EX-SEA5-D.ant.amazon.com>
(this is a PERSONAL response)

Tomas observed:
> 
> UTF8 should be the last option in a set of rules; e.g.,
> 
>  - Get if from the HTTP header
>  - If not, get if from META
>  - If not, ...
>  - if not UTF8
> 

The problem with making UTF-8 the "last resort" encoding is that, ironically, it is possible to detect when something isn't UTF-8 and thus know that the encoding selected is wrong (this is not true of most encodings). If a document really isn't UTF-8, the byte pattern will quite probably reveal that fact, although possibly after an inconveniently large number of bytes in the document have been read. So to make an encoding the "last resort" and presenting data in a way known to be flawed seems less than ideal :-(. It might be better to offer the user the opportunity to correct the encoding, etc., in that case.

UTF-8 might be a good guess for higher in the encoding detection stack, though, and by all means should be the "default" (that is, recommended) encoding for authoring Web documents. If encoding announcement (via meta or some other mechanism) can be required in HTML5, it would also be good to make it the default encoding there. 

Addison

Addison Phillips
Globalization Architect -- Lab126
Chair -- W3C Internationalization WG

Internationalization is not a feature.
It is an architecture.



Received on Tuesday, 2 June 2009 01:09:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 19:17:19 GMT