HTML Guide for windows-1252
A <meta> tag has been found in the document stating that the charset is windows-1252, but it actually is utf-8. You should update the tag to reflect the actual encoding of the document, for example:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
In HTML5 you’re encouraged to use Unicode (UTF-8) character encoding rather than a legacy character encoding such as Latin1 (Windows-1252 or ISO 8859-1).
In short, it can be just a matter of using <meta charset="utf-8"/> in your document, but you should also ensure that your pages are also saved and served as UTF-8.
Mismatch between the declared character encoding and the actual encoding confuses browsers and validators, and can cause character display issues.
The charset declaration in the meta tag should match the actual character encoding of your HTML file. Declaring "iso-8859-1" but saving the file as "windows-1252" (or vice versa) creates a conflict, since these encodings are similar but not identical. Moreover, UTF-8 is the recommended encoding for web documents, widely supported and preferable for modern websites.
To resolve the issue:
- Decide which character encoding your HTML file should use.
- Save your document with that encoding in your text editor or IDE.
- Ensure your HTML declares the same encoding using the meta tag in the <head> section.
Example using UTF-8 (recommended):
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example</title>
<meta charset="utf-8">
</head>
<body>
<p>Hello, world!</p>
</body>
</html>
If you specifically want iso-8859-1:
- Save the file as iso-8859-1 in your editor.
-
Declare it in your HTML:
<!DOCTYPE html> <html lang="en"> <head> <title>ISO Example</title> <meta charset="iso-8859-1"> </head> <body> <p>Bonjour, monde !</p> </body> </html>
Make sure your editor does not save the file as windows-1252 if you declare iso-8859-1 in your HTML. For best compatibility, use UTF-8 for both saving and declaring the document encoding.