[html5] Validator is incorrectly detecting that the page encoding is utf-8 when it is actually iso-8859-1
brett.ryan at gmail.com
Tue Mar 26 01:19:48 PDT 2013
I continually get this validation error, though I have verified that the page is in fact encoded in windows-1252.
Internal encoding declaration “iso-8859-1” disagrees with the actual encoding of the document (“utf-8”).
I have verified the document by downloading from the server using cURL and uploading to the w3 checker (http://validator.w3.org/check) which validates the document as the correct encoding (apart from the encoding name of windows-1252).
I've taken the following steps to ensure encoding is correct:
Process that starts forces LANG='iso-8859-1'
Forcing file.encoding on tomcat startup -Dfile.encoding=iso-8859-1, this is confirmed by checking Charset.defaultCharset() which reports ISO-8859-1.
Maven project resources are copied with iso-8859-1: <project.build.sourceEncoding>iso-8859-1</project.build.sourceEncoding>
JSP page directive specifies encoding: <%@page contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
Content-Type has been set in page head: <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
Tomcat URIEncoding set: <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" URIEncoding="iso-8859-1" redirectPort="8443" />
This is following from the SO question I have Why does my HTML validator keep reporting a different encoding to that of the page?
To the moderator, I apologise I accidentally sent the original message from my other email account.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Help