Accesskey n skips to in-page navigation. Skip to the content start.
These tests check whether user agents recognise character encoding declarations for HTML and XHTML documents, and apply the expected prioritisation in case of mismatches between multiple declarations.
See the results below for user agents tested. This section summarizes the results of those tests. In what follows, 'HTML' means HTML4.01 or XHTML 1.0 served as text/html. XML means XHTML 1.0 or XHTML 1.1 served as application/xhtml+xml.
All user agents detected character encodings declared in the HTTP header for HTML and XML.
The XML declaration was used by all XML pages, but was also used by HTML documents for all browsers tested apart from IE. This use for HTML is not specified.
The meta Content-Type element was used to set the encoding for HTML but not XML, with the exception of Opera, which recognized this declaration for XML documents. Opera goes beyond the specification in this respect.
The HTML5 charset meta element was recognized for HTML, but not for XML by all browsers. Note that this syntax is not described in the HTML 4.01 specification (but will be in HTML5), so documents containing this declaration do not validate.
The precedence rules described in the HTML specification related to the HTTP header, the XML declaration and the meta Content-Type are all followed by all browsers tested, ie. HTTP header trumps all; XML declaration wins over meta Content-Type for XML, and vice versa for HTML.
When both a meta Content-Type and HTML5 meta charset declaration appear in an HTML page, the first always trumps the second.
These are results for the latest versions of each user agent tested. A green background (yes) means that the assertion associated with the test held true; red (no) means that it did not; orange (partially) means that it was only partially true. To view the assertion, click on the text in the left column.
Results are given for four types of document format: H4 (HTML 4.01), XH (XHTML 1.0 served as text/html), X (XHTML 1.0 served as XML), X11 (XHTML 1.1, served as XML).
| UA | IE1 | IE1 | Firefox | Opera | Safari | Chrome | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| version | 8 | 7 | 3.5.1 | 9.64 | 4.0.2 | 2.0.172.37 | ||||||||||||||||||
| OS | XP | XP | XP | XP | XP | XP | ||||||||||||||||||
| date | 20090717 | 20090717 | 20090717 | 20090717 | 20090717 | 20090717 | ||||||||||||||||||
| format | H4 | XH | X | X11 | H4 | XH | X | X11 | H4 | XH | X | X11 | H4 | XH | X | X11 | H4 | XH | X | X11 | H4 | XH | X | X11 |
| meta Content-Type charset declaration | yes | yes | n/a | n/a | yes | yes | n/a | n/a | yes | yes | yes | yes | yes | yes | no3 | no3 | yes | yes | yes | yes | yes | yes | yes | yes |
| HTML5 meta charset declaration | yes | yes | n/a | n/a | yes | yes | n/a | n/a | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| XML declaration | yes | yes | n/a | n/a | yes | yes | n/a | n/a | no2 | no2 | yes | yes | no2 | no2 | yes | yes | no2 | no2 | yes | yes | no2 | no2 | yes | yes |
| HTTP charset declaration | yes | yes | n/a | n/a | yes | yes | n/a | n/a | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
Notes:
| UA | IE1 | IE1 | Firefox | Opera | Safari | Chrome | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| version | 8 | 7 | 3.5.1 | 9.6.4 | 4.0.2 | 2.0.172.37 | ||||||||||||||||||
| OS | XP | XP | XP | XP | XP | XP | ||||||||||||||||||
| date | 20090717 | 20090717 | 20090717 | 20090717 | 20090717 | 20090717 | ||||||||||||||||||
| format | H4 | XH | X | X11 | H4 | XH | X | X11 | H4 | XH | X | X11 | H4 | XH | X | X11 | H4 | XH | X | X11 | H4 | XH | X | X11 |
| HTTP vs meta Content-Type | yes | yes | n/a | n/a | yes | yes | n/a | n/a | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| HTTP vs HTML5 meta | yes | yes | n/a | n/a | yes | yes | n/a | n/a | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| HTTP vs XML declaration | yes | yes | n/a | n/a | yes | yes | n/a | n/a | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| XML declaration vs meta Content-Type | yes | yes | n/a | n/a | yes | yes | n/a | n/a | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| XML declaration vs HTML5 meta | yes | yes | n/a | n/a | yes | yes | n/a | n/a | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| meta Content-Type, then HTML5 meta | yes | yes | n/a | n/a | yes | yes | n/a | n/a | yes | yes | yes | yes | yes | yes | no | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| HTML5 meta, then meta Content-Type | yes | yes | n/a | n/a | yes | yes | n/a | n/a | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
Notes:
Tell us what you think (English).
Content first published 2009-04-16. Last substantive update 2009-07-18 7:00 GMT. This version 2009-07-18 7:00 GMT
For the history of document changes, search for results-lang-and-cjk-font in the i18n blog.
Copyright © 2009 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.