HTML5“将数字字符引用扩展到C1控件范围”时,使用“

问题描述 投票:15回答:2

我有这个html代码:

<span class="comma_left">&#147;</span>

<span class="comma_right">&#148;</span>

同样,都代表左右逗号。

尽管很奇怪,HTML5 validation引发错误:

“数字字符引用已扩展到C1控件范围。”

我真的不想只是避免出现此错误,我该怎么办?

html html5
2个回答
31
投票

C1 control range是指映射到Latin-1中的字节编码0x80至0x9f(128至159)或Unicode code points U+0080 to U+009F的字符。 Unicode认为它们是"control characters",明确地是disallowed by the HTML5 parsing algorithm

您的问题正在发生,因为您使用的是定向双引号的Windows code page 1252编码,该编码与Latin-1和Unicode不兼容。您可以尝试以下兼容的变体:


3
投票

尝试将&#8220;更改为&rdquo; or &#8221;,将&rdquo;更改为&#8221;,因为它是相同的角色并且是有效的W3C。

© www.soinside.com 2019 - 2024. All rights reserved.