过去两个小时我一直在尝试验证我的网页,在成功验证之前我只剩下一个错误,但我不断遇到字符解码问题,我无法解决它......
整个文档都很好,除了它说......
Sorry, I am unable to validate this document because on line 77 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 "\x85" does not map to Unicode
第 77 行唯一的内容是一些 <p>
内的一些文本。标签,我尝试将它们更改为 <a>
,或<span>
并采取 <p>
远离,因此它在 div
内松动但只有当我删除标签内的文本时,错误才会消失。
我使用的是 utf-8 编码:
<meta http-equiv="Content-type" content="text/html;charset=utf-8" />
如果这个问题很容易解决,我很抱歉,我的知识非常基础,我只是一年级的计算机学生。
编辑: <p>
内的文本标签如下:
<p>
Our team thrives on the latest political news as we do you. We work around the clock to bring you the latest, most important news as soon as it happens. What do we ask in return… nothing! This site is funded by us! Your satisfaction is as much a pay packet to us then a wad of untraceable counterfeit notes.<br/><br/>
Sign up to our newsletter to get regular updates on news as soon as it happens without having to navigate to our site. For your security we only sell the details you input to our site to companies who “pinky promise” they won’t be naughty with them.<br/><br/>
StudentPolitics.Now – Trading in satisfying others since 2011</p>
最佳答案
问题在于该文档仅声称是 UTF-8,但事实并非如此。
配置您的编辑器以该格式保存( W3C has a guide for a number of them )。
如果您以编程方式修改 HTML,请检查程序(和/或数据库,如果正在运行)是否正在修改数据或存储非 UTF-8 数据。
如果这不起作用,请尝试删除文本并重新输入。您可能有一个零宽度字符,无法在其中正确表示。
关于HTML、XHTML 验证错误 - 无法解决,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5302897/