Linux 设置同时支持GBK(GB2312)和UTF-8编码
vi /etc/httpd/conf/httpd.conf
Apache中决定服务器编码的httpd.conf中AddDefaultCharset决定的,我设置为AddDefaultCharset utf-8,所以服务器默认是utf-8的;AddDefaultCharset utf-8上面有一段注释:
# 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:
大概意思是:指定一个默认的字符集传送内容;这将所有内容默认以utf-8编码解析。如果要使用浏览器默认选择(ISO-8859-1),或允许使用HTML的META来自动选择浏览器编码,注释掉这行即可。
那就是改为 # AddDefaultCharset utf-8,这样此行不再起作用,浏览器将根据网页的META来选择字符编码,apache就可以支持多字符编码了。
相关推荐
  心中要有一片海    2012-10-22  
   87437616    2011-05-09  
   qiaosym    2010-07-07  
   butterflyfly00    2019-06-25  
   88384758    2013-04-16  
   89781232    2011-12-08  
   yangliuhepanpan    2014-10-22  
   learningever    2020-09-19  
   81214051    2020-06-01  
   ITxiaobaibai    2020-03-23  
   84590091    2020-02-16  
   zhangxiaocc    2019-10-24  
   eastnow    2012-10-11  
   secondid    2010-07-26  
   shutFuckingup    2010-06-12  
   XTUxiaoxin    2011-03-06  
   谢恩铭    2013-07-11  
 