Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1730955
  • 博文数量: 234
  • 博客积分: 4966
  • 博客等级: 上校
  • 技术积分: 3322
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-13 01:03
文章分类

全部博文(234)

文章存档

2017年(2)

2016年(1)

2015年(8)

2014年(11)

2013年(44)

2012年(27)

2011年(22)

2010年(30)

2009年(37)

2008年(6)

2007年(45)

2006年(1)

分类: 系统运维

2009-01-09 19:31:46

难道apache不能同时支持utf-8和gb2312吗?

apache中决定服务器编码的httpd.conf中AddDefaultCharset决定的,我设置为AddDefaultCharset utf-8,所以服务器默认是utf-8的;后来自己去看httpd.conf文件的配置,仔细看了后才发现配置文件解释的很清楚了,都是自己没看导致的。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就可以支持多字符编码了。

以后要多看自带说明:(

阅读(3313) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~