[英]Charset omitted from content-type header
In my <head>
, I have:在我的
<head>
中,我有:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Because I'm seeing a couple of funky characters, I took a closer look at the Content-Type
response header in Firebug (and Safari's inspector) and both read Content-Type:text/html
.因为我看到了几个时髦的字符,所以我仔细查看了 Firebug(和 Safari 的检查器)中的
Content-Type
响应 header 并且都读取了Content-Type:text/html
。 No indication that the charset is recognized.没有迹象表明该字符集已被识别。 I'm using an HTML5 doctype and have also tried
<meta charset="utf-8" />
.我正在使用 HTML5 文档类型并且也尝试过
<meta charset="utf-8" />
。 Neither has worked or changed the value I see in the inspectors.两者都没有起作用或改变我在检查员中看到的价值。
I'm assuming that both developer tools would report the accurate Content-Type
including the charset, but I guess I've never had a reason to look all that closely.我假设这两种开发工具都会报告准确的
Content-Type
包括字符集,但我想我从来没有理由仔细查看所有内容。 Is there anything else I should do to ensure that the page is rendered with the UTF8 character set?我还应该做些什么来确保页面以 UTF8 字符集呈现?
I'm not sure this is my problem, but it seemed odd so I thought I'd ask.我不确定这是我的问题,但它似乎很奇怪,所以我想我会问。 Maybe my expectations are incorrect.
也许我的期望是不正确的。
Thanks.谢谢。
Although it may not have been my problem, I "corrected" the Content-Type
response header to appear as expected (with the charset attached) by including the Apache directive AddDefaultCharset UTF-8
in my htaccess file.虽然这可能不是我的问题,但我通过在 myhtaccess 文件中包含 Apache 指令
AddDefaultCharset UTF-8
,“更正”了Content-Type
响应 header 以按预期显示(附加字符集)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.