Prerequisites: The default encoding for the browser you are testing must not be set to UTF-8.

UTF-8 BOM

Test passes if you see two green boxes.
Skip the test if you see two squares of different colors.
Test fails if you see two red squares.

Assertion: A page with no other encoding declarations, but with a UTF-8 signature will be recognized as UTF-8 if the browser's default is not UTF-8.

Notes:

This page is served with no character encoding declarations in HTTP or inside the document other than a UTF-8 BOM.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the top box will turn green.

This test only produces a positive result if the browser doesn't by default treat the page as UTF-8. The lower box tests the default encoding (applied when no character encoding information is present). If the default encoding is UTF-8, this lower box will turn red. In such a case, it is not possible to tell whether the BOM is making a difference, so the test should be skipped.

Next test
XHTML5

character-encoding-xhtml-002
Result summary & related tests
Detailed results for this test