LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1327|回复: 7

为什么Apache里的字符集已经改成GB2312 但显示中文还是乱码,为什么呀?

[复制链接]
发表于 2006-10-15 19:24:35 | 显示全部楼层 |阅读模式
为什么Apache里的字符集已经改成GB2312 但显示中文还是乱码,为什么呀?
AddDefaultCharset GB2312 和 AddDefaultCharset off 都试过了 重新启动过N次了 都没用呀 :ask :help



Index of /鍩硅瑙嗛
Name Last modified Size Description

--------------------------------------------------------------------------------

Parent Directory    -  
浣欎笘缁磋搴?  14-Oct-2006 21:38  -  

--------------------------------------------------------------------------------


Apache/2.0.52 (Red Hat) Server at 10.0.1.8 Port 80
发表于 2006-10-15 19:35:23 | 显示全部楼层
不要改,默认设置就支持,apache2的
把AddDefaultCharset 那行注释掉
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-10-15 19:44:16 | 显示全部楼层
Post by zwithersir
不要改,默认设置就支持,apache2的
把AddDefaultCharset 那行注释掉



注释掉了还是没用哦  !!!:help
回复 支持 反对

使用道具 举报

发表于 2006-10-15 21:22:08 | 显示全部楼层
你的系统是什么编码?
请运行
locale
回复 支持 反对

使用道具 举报

发表于 2006-10-15 21:32:12 | 显示全部楼层
Apache的目录列表功能默认不支持中文, 请不要使用中文做目录名.
回复 支持 反对

使用道具 举报

发表于 2006-10-16 00:24:44 | 显示全部楼层
if your system locale using utf-8, you may try this patch....
  1. diff -ruN httpd-2.0.55/modules/generators/mod_autoindex.c httpd-2.0.552/modules/generators/mod_autoindex.c
  2. --- httpd-2.0.55/modules/generators/mod_autoindex.c        2006-07-22 02:21:13.000000000 +0800
  3. +++ httpd-2.0.552/modules/generators/mod_autoindex.c        2006-07-22 02:26:47.000000000 +0800
  4. @@ -152,7 +152,7 @@
  5. static void emit_preamble(request_rec *r, int xhtml, const char *title)
  6. {
  7.      ap_rvputs(r, xhtml ? DOCTYPE_XHTML_1_0T : DOCTYPE_HTML_3_2,
  8. -              "<html>\n <head>\n  <title>Index of ", title,
  9. +              "<html>\n <head>\n  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n  <title>Index of ", title,
  10.                "</title>\n </head>\n <body>\n", NULL);
  11. }
复制代码
回复 支持 反对

使用道具 举报

发表于 2006-10-16 09:42:16 | 显示全部楼层
Post by ideawu
Apache的目录列表功能默认不支持中文, 请不要使用中文做目录名.

这句话说的不对
回复 支持 反对

使用道具 举报

发表于 2006-11-15 11:03:58 | 显示全部楼层
先看看里面有没有这样的设置,没有的再加上去,
AddCharset GB2312 .gb2312 .gb
AddLanguage zh_cn .cn
再加上那个AddDefaultCharset=gb2312就可以显示中文了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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