Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php meta标签应该是utf-8还是无关紧要?_Php_Html_Meta Tags - Fatal编程技术网

Php meta标签应该是utf-8还是无关紧要?

Php meta标签应该是utf-8还是无关紧要?,php,html,meta-tags,Php,Html,Meta Tags,我应该用utf-8格式写元标记吗 例如,在meta关键字中使用双引号可以吗 19" wheels 或特殊字符,如&符号 谢谢 注意:我所有的页面都使用utf-8编码 字符集取决于对整个页面进行编码的集合 对于引号和其他特殊字符,您需要使用以下方法对其进行转义: 至于真正特殊的角色,比如国, 只要页面使用适当的编码,即utf-8,它们就可以使用 我应该用utf-8格式写元标记吗 您应该在整个过程中使用一致的编码 例如,在meta关键字中使用双引号可以吗 与所有属性值一样,如果不使用实体表示属性

我应该用utf-8格式写元标记吗

例如,在meta关键字中使用双引号可以吗

 19" wheels
或特殊字符,如&符号

谢谢


注意:我所有的页面都使用utf-8编码

字符集取决于对整个页面进行编码的集合

对于引号和其他特殊字符,您需要使用以下方法对其进行转义:

至于真正特殊的角色,比如国, 只要页面使用适当的编码,即utf-8,它们就可以使用

我应该用utf-8格式写元标记吗

您应该在整个过程中使用一致的编码

例如,在meta关键字中使用双引号可以吗

与所有属性值一样,如果不使用实体表示属性值,则不能在值中使用分隔属性值的字符

<meta name="length" content="19""> <!-- This is an error -->
<meta name="length" content='19"'> <!-- This is fine -->
<meta name="length" content='19&quot;'> <!-- This is fine -->
<meta name="length" content="19&quot;"> <!-- This is fine -->
<meta name="length" content="19″"> <!-- Using the double prime character is also fine.
                                        It is distinct from the double quotes used to 
                                        delimit the attribute value.
                                        Technically, it is the best option as it is the
                                        correct character to represent an inch.
                                     -->
或特殊字符,如&符号


有时,您可以在HTML数据中使用原始的“与”,但这种情况并不常见,而且始终使用&;然后试着记住例外情况。

我在所有页面上都使用utf-8。。。如果我使用html实体或其他名称,这有关系吗?对于引号,符号和其他控制字符您肯定应该使用编码版本。我认为您混淆了UTF-8(它指定了一种字符编码类型)和使用HTML实体转义特殊字符的需要。您不需要UTF-8来表示双引号,它们是纯7位ASCII。
<meta name="length" content="19""> <!-- This is an error -->
<meta name="length" content='19"'> <!-- This is fine -->
<meta name="length" content='19&quot;'> <!-- This is fine -->
<meta name="length" content="19&quot;"> <!-- This is fine -->
<meta name="length" content="19″"> <!-- Using the double prime character is also fine.
                                        It is distinct from the double quotes used to 
                                        delimit the attribute value.
                                        Technically, it is the best option as it is the
                                        correct character to represent an inch.
                                     -->