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

[whatwg] Charset sniffing from XML prolog

From: Kartikaya Gupta <lists.whatwg@stakface.com>
Date: Wed, 07 Oct 2009 23:12:01 +0000
Message-ID: <20091007231202.88F9A14DF5B@looneymail-mx2.g.dreamhost.com>
If a document is served as text/html, but contains an XML prolog with an encoding attribute, it seems that all Firefox, Opera, and Chrome all pick up the encoding from the prolog and use it when parsing the rest of the document. (IE6 does not). The HTML5 spec doesn't seem to include XML-prolog checking in its encoding sniffing algorithm, should it?

<?xml version="1.0" encoding="utf-8"?>
<html>insert utf-8 content here, or alert(document.inputEncoding) for browsers that support it</html>
Received on Wednesday, 7 October 2009 16:12:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:17 UTC