In order to obtain the correct rendering of text content, a declaration of the character set must be included on each page. In the following example, the <meta>
tag is used.
<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> […] </head>
This <meta>
tag must be inserted as high as possible in the HTML page, before any content that is displayed on the screen, and preferably immediately after the opening <head>
tag.
Remember also to check the correct coding of characters that are not automatically displayed on the screen, especially:
title
attributes.
HTML5 simplifies the writing of the <meta>
tag for the declaration of the character set. If you choose this type of document, you just need to use a statement like: <meta charset=“UTF-8”>
.