简体   繁体   English

缺少字符集标题错误

[英]Missing charset header error

I have tried the following code. 我尝试了以下代码。 But still Charset header is missing, error is coming 但是仍然缺少Charset标头,错误即将来临

 <!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>

I have used this line as well: 我也使用了这一行:

<meta charset="utf-8">...  

but the error persists. 但错误仍然存​​在。

Try with removing / at the end of the meta tag. 尝试在meta标签的末尾删除/。

Thanks. 谢谢。

Start your HTML-document like this: 像这样启动HTML文档:

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Page Title</title>
</head>
...

I found a solution but it's not in META of page (I spent a few hours on this way), it's in server configuration, adding charset configuration in ngingx virtual server configuration 我找到了一个解决方案,但是它不在页面的META中(我花了几个小时这样做),它在服务器配置中,在ngingx虚拟服务器配置中添加了字符集配置

charset UTF-8; 字符集UTF-8;

I don't know about apache configuration but it should be very similar try somethin like : 我不了解apache的配置,但它应该非常相似,例如:

AddDefaultCharset utf-8 添加默认字符集utf-8

now I have a problem, while I type curl -I www.w3sos.com (my testing environment) I don't see the result, but when I use a web test solution like site analyzer it works ... 现在我有一个问题,当我键入curl -I www.w3sos.com(我的测试环境)时,我看不到结果,但是当我使用网站测试器之类的Web测试解决方案时,它可以工作...

good luck, it was my 50 cents for this questions 祝你好运,这是我的50美分

greg 格雷格

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM