Checker messages

From Internationalization

This is a list of messages for the i18n checker, with information about where each message is used.

For each message there are one or more lines that include the following information:

  • whether the message is used as an error, warning or comment
  • what formats this is applicable to (nothing indicates all)
  • what conditions must apply

xhtmlH means XHTML 1.0 served as text/html; xhtmlX means xhtml1.0 served as application/xhtml+xml; xhtml1.1 means XHTML 1.1 served as application/xhtml+xml.

The tests have not been checked yet for XHTML5.

(TBI) means to be implemented.


Character encoding

Related to the HTTP header

Encoding declared only in HTTP

  • only encoding information is in HTTP header

Add information to indicate the character encoding of the page inside the page itself. [rep_charset_no_in_doc]

Related to BOM

UTF-8 BOM found at start of file

  • page has a utf-8 bom at the top

Using an editor or an appropriate tool, remove the byte order mark from the beginning of the file. This can often be achieved by saving the document with the appropriate settings in the editor. On the other hand, some editors (such as Notepad on Windows) do not give you a choice, and always add the byte order mark. In this case you may need to use a different editor. [rep_charset_bom_found]


BOM found in content

  • page has a utf-8 bom below the start of the file

Using an editor or an appropriate tool, remove the byte order mark from the beginning of the file or chunk of content where it appears. If the problem does arise from a BOM at the top of an included file, this can often be achieved by saving the content with appropriate settings in the editor. On the other hand, some editors (such as Notepad on Windows) do not give you a choice, and always add the byte order mark. In this case you may need to use a different editor. [rep_charset_bom_in_content]

No visible in-document encoding specified

  • html, xhtmlH, xhtmlX, xhtml11 (no xml declaration and no meta declaration) and (utf-8 or utf-16 bom detected)
  • html5, xhtml5 (no xml declaration and no meta declaration) and (utf-8 bom detected)

Basic message: Use a visible encoding declaration as well as the bom [rep_no_visible_charset]

Cf: No in-document encoding found, which is used when HTTP alone is used. This message covers the case where only bom or http+bom are used.

Related to XML declaration

XML declaration used

  • html, html5 page has an xml declaration
  • xhtmlH page has an xml declaration

Remove the XML declaration from your page if you are using HTML4, HTML5 or XHTML5. If you are serving XHTML 1.x as HTML (text/html), use UTF-8 for your page and remove the XML declaration. [rep_charset_xml_decl_used]

No effective character encoding information

  • html,html5,xhtml XML declaration but no other encoding declaration

Basic message: Use the most appropriate method for declaring encoding information. [rep_no_effective_charset]

Related to meta declaration

Meta encoding declarations don't work with XML

  • xhtml:xml, xhtml11:xml Content-Type or charset meta encoding declaration found

Basic message: Meta tag has no effect in XML, document will be treated as utf8/16 by default [rep_meta_ineffective]

Meta charset tag will cause validation to fail

  • html,xhtml,xhtml:xml,xhtml11:xml charset meta found

Basic message: Although recognized by browsers, meta charset not in html5 will cause validation to fail [rep_meta_charset_invalid]

Incorrect use of meta encoding declaration

  • xhtml only encoding declarations found is Content-Type or charset meta and encoding specified is not utf8/utf16
  • xhtmlX, xhtml11 only encoding declarations found is Content-Type or charset meta and encoding specified is not utf8/utf16

Basic message: If there is no XML declaration you must use utf8/utf16 [rep_incorrect_use_meta]

Multiple encoding declarations using the meta tag

  • all more than one meta encoding declaration found

Edit the markup to remove all but one meta element. [rep_charset_multiple_meta]


Meta character encoding declaration used in UTF-16 page

  • html5 UTF16 encoded document and meta encoding declaration used

Remove the meta encoding declaration. [rep_charset_utf16_meta]

UTF-16 encoding declaration in a non-UTF-16 document

  • non-utf16-encoded document and utf16 meta encoding declaration used

Change the encoding declaration to reflect the actual encoding of the page. [rep_charset_bogus_utf16]

UTF-16LE or UTF-16BE found in a character encoding declaration

  • utf16be or utf16le encoding declaration used in meta, xml declaration, or http declaration

Ensure that the page starts with a byte-order mark (BOM) and change the encoding declaration(s) to "UTF-16". [rep_charset_utf16le-be]

Related to charset attribute

charset attribute used on a or link elements

  • html5 charset used on a or link element
  • html,xhtml charset used on a or link element

Remove the charset attribute. If pointing to a page that is under your control, ensure that any appropriate character encoding information is provided for that page. [rep_charset_charset_attr]


Other

No character encoding information

  • html,html5,xhtml no encoding information found at all

Add information to indicate the character encoding of the page. [rep_charset_none]

No in-document encoding declaration found

  • xhtml:xml,xhtml11:xml no encoding information found at all

Add information to indicate the character encoding of the page inside the page itself. [rep_no_encoding_xml]

Non-UTF8 character encoding declared

  • any type of encoding declaration detected that doesn't declare utf-8

Save your content as UTF-8, and change the encoding declarations. [rep_charset_no_utf8]

New messages (TBD)

Bad choice of character encoding

  • page has an encoding declaration matching one of the following: CESU-8 csCESU-8 UTF-7 UNICODE-1-1-UTF-7 csUnicode11UTF7 BOCU-1 csBOCU-1 or SCSU

This character encoding was never intended for use with Web content. The HTML5 specification says that browsers must not support it.

Choose a different encoding for your document. UTF-8 is recommended.Set your authoring tool to save your content in that encoding and change the encoding declarations. [rep_charset_bad]

Deprecated character encoding

  • page has an encoding declaration matching one of the following: JIS_C6226-1983 iso-ir-87 x0208 JIS_X0208-1983 csISO87JISX0208 | JIS_X0212-1990 x0212 iso-ir-159 csISO159JISX02121990 | HZ-GB-2312 | JOHAB windows-1361 | ISO-2022-JP csISO2022JP ISO-2022-JP-2 csISO2022JP2 | OSD_EBCDIC_DF04_15 OSD_EBCDIC_DF03_IRV OSD_EBCDIC_DF04_1 IBM037 cp037 ebcdic-cp-us ebcdic-cp-ca ebcdic-cp-wt ebcdic-cp-nl csIBM037 etc | UTF-32 UTF-32BE UTF-32LE

In this character encoding bytes in the range 0x20 to 0x7E can encode characters other than the corresponding characters in the range U+0020 to U+007E. This represents a potential security vulnerability: a user agent that does not support the encoding (or does not support the label used to declare the encoding, or does not use the same mechanism to detect the encoding of unlabelled content as another user agent), might end up interpreting technically benign plain text content as HTML tags and JavaScript. The HTML5 specification recommends that this character encoding is avoided.

Choose a different encoding for your document. UTF-8 is recommended.Set your authoring tool to save your content in that encoding and change the encoding declarations. [rep_charset_deprecated]


Language

Related to attributes

A tag uses a lang attribute without an associated xml:lang attribute

  • xhtml,xhtmlX,xhtml11 lang attribute in a tag with no xml:lang

Add an xml:lang attribute to each of the above tags, with the same value as the lang attribute. [rep_lang_missing_xml_attr]

A tag uses an xml:lang attribute without an associated lang attribute

  • html5 xml:lang attribute in a tag with no lang
  • xhtml xml:lang attribute in a tag with no lang

Add a lang attribute to each of the above tags, with the same value as the xml:lang attribute. [rep_lang_missing_html_attr]

A lang attribute value did not match an xml:lang value when they appeared together on the same tag.

  • in any tag, xml:lang and lang attributes don't match

Change one of the values by editing the markup. [rep_lang_conflict]

The html tag has no language attribute

  • html tag has no xml:lang and no lang attribute

Add a lang attribute that indicates the default language of your page. Example: lang='de' [rep_lang_no_lang_attr]

The html tag has no effective language declaration

  • html,html5,xhtml html tag has no lang attribute
  • xhtmlX,xhtml11 html tag has no xml:lang

For pages served as HTML, use the lang attribute. For pages served as XML, use the xml:lang attribute. For pages, such as XHTML 1.0 that may be treated as either HTML or XML, use both. [rep_html_no_effective_lang]

This HTML file contains xml:lang attributes

  • html any tag has an xml:lang attribute

Remove the xml:lang attributes from the markup, replacing them, where appropriate, with lang attributes. [rep_lang_xml_attr_in_html]

A language value was incorrectly formed

  • html any tag has an xml:lang or lang attribute with an incorrect value

Change the attribute values to conform to BCP47 syntax rules. [rep_lang_malformed_attr]

Related to Content-Language meta

Content-Language meta element used

  • html5 Content-Language meta element found
  • html,xhtml,xhtmlX,xhtml11 Content-Language meta element found

Remove the Content-Language meta element, and ensure that you have used an attribute on the html tag to specify the default language of the page. [rep_content_lang_meta]


Non-Latin values

Class or id names found that are not in Unicode Normalization Form C

  • html,html5,xhtml,xhtmlX,xhtml11 non-NFC class or id names found

It is recommended to save all content as Unicode Normalization Form C (NFC). [rep_misc_non_nfc]


Markup

General

<b> tags found with no class attribute.

  • html,html5,xhtml,xhtmlX,xhtml11 b tag found without class attribute

You should not use <b> tags if there is a more descriptive and relevant tag available. If you do use them, it is usually better to add class attributes that describe the intended meaning of the markup, so that you can distinguish one use from another. [rep_misc_tags_no_class]

<i> tags found with no class attribute.

  • html,html5,xhtml,xhtmlX,xhtml11 i tag found without class attribute

You should not use <i> tags if there is a more descriptive and relevant tag available. If you do use them, it is usually better to add class attributes that describe the intended meaning of the markup, so that you can distinguish one use from another. [rep_misc_tags_no_class]

Related to direction

Incorrect dir values

  • html,xhtml,xhtmlX,xhtml11 dir attribute has value that is not rtl or ltr
  • html5 dir attribute has value that is not rtl, ltr or auto

Correct the attribute values. [rep_dir_incorrect]


Bdo tag without dir attribute

  • bdo element has no dir attribute

Add a dir attribute to each bdo tag. [rep_markup_bdo_no_dir]