Problème UTF-8

WRInaute discret
Bonjour,

je viens de lancer une petite analyse de mon site pour vérifier son état avec le site validator.w3.ord et voilà ce le compte rendu

The validator has found the following problem(s) prior to validation, which should be addressed in priority:

No Character Encoding Found! Falling back to UTF-8.
I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to reliably validate the document. I'm falling back to the "UTF-8" encoding and will attempt to perform the validation, but this is likely to fail for all non-trivial documents.

The sources I tried to find encoding information include:

The HTTP Content-Type field.
The XML Declaration.
The HTML "META" element.
And I even tried to autodetect it using the algorithm defined in Appendix F of the XML 1.0 Recommendation.

Since none of these sources yielded any usable information, I will not be able to reliably validate this document. Sorry. Please make sure you specify the character encoding in use.

Specifying a character encoding is typically done by the web server configuration, by the scripts that put together pages, and inside the document itself. IANA maintains the list of official names for character encodings (called charsets in this context). You can choose from a number of encodings, though we recommend UTF-8 as particularly useful.

The W3C I18N Activity has collected a few tips on how to do this.

To quickly check whether the document would validate after addressing the missing character encoding information, you can use the "Encoding" form control earlier in the page to force an encoding override to take effect. "iso-8859-1" (Western Europe and North America) and "utf-8" (Universal, but not commonly used in legacy documents) are common encodings if you are not sure what encoding to choose.


Sorry, I am unable to validate this document because on line 229 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.

The error was: utf8 "\xE9" does not map to Unicode

Qu'est ce que je dois faire exactement?
 
WRInaute impliqué
bizgratuit a dit:
Qu'est ce que je dois faire exactement?
Le message est pourtant clair.
Tu n'as pas indiqué de "character encoding" sur ta page. Le validateur choisi donc lui-même l'UTF-8 mais ne peut pas analyser ta page car il ne comprend pas un caractère ligne 229 ...

Donc tu indiques l'encodage de tes caractères ("charset"), et si tu choisis UTF-8, tous tes fichiers doivent être codés en UTF-8...

Pour définir le charset:
Code:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Ou via header
Code:
Content-Type: text/html; charset=UTF-8
 
Discussions similaires
Haut