Re: Default charset in HTML5

Nick <halbtaxabo-temp4@yahoo.com>, 2017-03-09 13:46 +0000:
> Archived-At: <http://www.w3.org/mid/53672439.2120582.1489067212112@mail.yahoo.com>
> >Michael[tm] Smith <mike@w3.org>:
...
> >And for legacy backward-compat, if a document doesn’t declare an encoding,
> >then browsers are required to parse it using windows-1252 as the encoding.
> 
> Really? Which current standards document says that?

https://html.spec.whatwg.org/#determining-the-character-encoding:concept-encoding-confidence-8

> Otherwise, return an implementation-defined or user-specified default
> character encoding, with the confidence tentative.
...
> In other environments, the default encoding is typically dependent on the
> user's locale (an approximation of the languages, and thus often
> encodings, of the pages that the user is likely to frequent). The
> following table gives suggested defaults based on the user's locale, for
> compatibility with legacy content.

windows-1252 is the default there for all user locales other than the ones
explicitly listed. In the context of checking a document with the HTML
checker there is no user locale to examine, so it uses windows-1252.

But as you can see from that table, the encoding that browsers will use for a
document that doesn’t declare an encoding changes based on the user’s locale.
For example, if the user’s locale is Japanese, browsers will use Shift_JIS.

  —Mike

-- 
Michael[tm] Smith https://sideshowbarker.net/

Received on Thursday, 9 March 2017 20:23:18 UTC