且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Content-Type HTTP标头缺少字符集属性

更新时间:2022-03-11 07:44:38

让我尝试回答,您可以通过编辑apache2.conf(对于Debian之类的OS)或httpd.conf(CentOS之类的OS( es))并添加以下几行:

Let me try to answer, you can do that by editing apache2.conf (for Debian like OS(es) ) or httpd.conf ( CentOS like OS(es) ) and add following lines:

#Set the correct Char set so don't need to set it per page.
AddDefaultCharset utf-8
#for css, js, etc.
AddCharset utf-8 .htm .html .js .css

来源:

  • https://httpd.apache.org/docs/2.4/mod/core.html#adddefaultcharset
  • https://httpd.apache.org/docs/2.4/mod/mod_mime.html#addcharset