HTML、XHTML 验证错误 - 无法解决

标签 html validation xhtml utf-8

过去两个小时我一直在尝试验证我的网页,在成功验证之前我只剩下一个错误,但我不断遇到字符解码问题,我无法解决它......

整个文档都很好,除了它说......

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/

相关文章:

ID、类和包含元素类型前缀的 HTML 命名约定?

html - XHTML 中的 WBR 替代方案

css - 如何在 XHTML 中制作按钮计票

html - 当右侧和左侧不同时,如何重复标题图像的背景?

javascript - 删除函数时重新加载总数 - 基于 HTML 和 JS 的表单

validation - 如何检查验证属性是否仅有空格

c# - 验证绑定(bind)到同一对象的不同属性的控件会重置对象值

jquery - 在页面中的每个图像弹出窗口中添加动态文本框以进行图像描述

php - 如何将产品 div float 到左侧而不是右侧

javascript - 删除特定字段的 novalidate