网页编码,设置相互矛盾 [英] web page encoding, with contradictory settings
本文介绍了网页编码,设置相互矛盾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果网页有,
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
…
</head>
但http标头有
Content-Type text/html; charset=UTF-8
那么假定编码是什么?
推荐答案
在HTML5中,优先级定义为:
In HTML5 the priority is defined as:
- 用户浏览器设置
- 字节顺序标记
- HTTP标头
-
< meta http-equiv =内容类型>
或< meta charset>
,具体取决于属性顺序。 - 浏览器默认值对于语言环境。
- User browser setting
- Byte order mark
- HTTP header
<meta http-equiv="Content-Type">
or<meta charset>
depending on attribute order.- Browser default for the locale.
参见 http://www.w3.org/html/wg/drafts/html/master/syntax.html#determining-the-character对于血淋淋的细节进行编码。
这篇关于网页编码,设置相互矛盾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文