全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 4157|回复: 0

Apache同时支持 utf-8和gb2312 两种编码问题

[复制链接]
发表于 2009-3-15 17:13:31 | 显示全部楼层 |阅读模式
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就可以支持多字符编码了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-4-25 23:24 , Processed in 0.056735 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表