配置apache支持多编码

# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default.  To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
#AddDefaultCharset UTF-8

理解上面的意思,说在AddDefaultCharset参数中可以设置服务器默认的编码,客户端就采用服务器端定义的编码显示。如果说想用META标签决定显示编码,那么就注释掉AddDefaultCharset这行,由浏览器自行选择。

<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />    //浏览器识别为utf-8

<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />   //gb2312

一般在服务器上存在多种编码的时候才会注释掉 AddDefaultCharset 配置。

(如果刷新没有效果,请清空浏览器缓存重试)