Picto thématique

Rule n° 225 - Each page’s source code contains metadata which defines the character set used.

While browsing, you may have come across strange display quirks on certain characters, question marks in small squares, for example. It is probably because the administrators of the sites where you found them did not respect this best practice.

#Structure and code #Development #SEO

Goal

  • Display pages offline correctly, by telling the browser which character set was used.
  • Prevent the risk of character display problems associated with the sometimes unsure functioning of browsers’ catch-up mechanisms when they don’t receive the necessary information from the HTTP content-type header.
  • Improve the accessibility of content for people with disabilities.
  • Improve the way content is taken into account by search engines and indexing tools.

Implementation

The meta element is completed according to the actual encoding of the document and its MIME type in the format:

  • meta charset="utf-8" in HTML5

Find out more:

Control

This criterion can be checked by examining the source code, using a development tool. For each page:

  • Check that the meta element http-equiv = "Content- Type" or charset is there.
  • Check the relevance of the character set indicated in its content or charset attribute.

By Opquast - Read the license