The w3.org HTML validator https://validator.w3.org unexpectedly shows an error for a HTML5 document which uses the encoding iso-8859-1.
The message is:
ErrorLegacy encoding windows-1252 used. Documents must use UTF-8.
I found many resources which only indicate UTF-8 being the recommended encoding. Did I miss something, or is the w3 validator error message questionable?
Example:
<!DOCTYPE html>
<html lang="fr">
<head>
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Untitled document</title>
</head>
<body>
<p>
à la mode
</p>
</body>
</html>
In HTML5, to specify the document's charset, you should use the newer
<meta charset="...">instead of the older<meta http-equiv="Content-Type" content="text/html; charset=...">(which is still supported for legacy reasons), eg:But, that being said, the current HTML5 standard states:
As well as:
Which means, the validator is correct. You are not allowed to use
Windows-1252/ISO-8859-1(or any other charset) anymore in modern HTML, only UTF-8. It is not just a recommendation, it is a requirement.Whether or not particular web browsers choose to enforce this requirement is another matter, though...