不懂你的意思,你这个看上去像是访问的文件本身就是utf-8的

解决方案 »

  1.   

    我用的是Apache2.0.47按道理来说,只修改httpd.conf中的AddDefaultCharset GB2312 就行记得重启服务器
      

  2.   

    既然“将浏览器字符集选为Unicode(UTF-8)才能显示中文”那么就说明你输出的本来就是UTF-8编码
      

  3.   

    AddDefaultCharset GB2312
    以后,只要重启,应该就好了,你的 PHP或 HTML文件有 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
    吗?
    没有的话,也加上
      

  4.   

    活活,httpd.conf默认的可是text/plain啊,你这一text/html岂不麻烦??我看楼主就是这个问题出乐叉子~~~~
      

  5.   

    应该是有两项
    DefaultLanguage zh-CN
    AddDefaultCharset ISO-2022-CN
      

  6.   

    没遇到过这个问题,我还停留在apache1.3.27
      

  7.   

    修改httpd.conf文件,它在apache安装路径/conf/下面
    找到AddDefaultCharset ISO-8859-1
    然后修改为:
    #AddDefaultCharset ISO-8859-1
    DefaultLanguage GB2312 
    AddLanguage zh-cn .cn 重启服务即可
      

  8.   

    httpd.conf中关于语言和字符集的内容
    # DefaultLanguage nl
    #
    # Note 1: The suffix does not have to be the same as the language
    # keyword --- those with documents in Polish (whose net-standard
    # language code is pl) may wish to use "AddLanguage pl .po" to
    # avoid the ambiguity with the common suffix for perl scripts.
    #
    # Note 2: The example entries below illustrate that in some cases 
    # the two character 'Language' abbreviation is not identical to 
    # the two character 'Country' code for its country,
    # E.g. 'Dan/dk' versus 'Danish/da'.
    #
    # Note 3: In the case of 'ltz' we violate the RFC by using a three char
    # specifier. There is 'work in progress' to fix this and get
    # the reference data for rfc1766 cleaned up.
    #
    # Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
    # English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
    # Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
    # Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
    # Norwegian (no) - Polish (pl) - Portugese (pt)
    # Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
    # Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
    #
    AddLanguage ca .ca
    AddLanguage cs .cz .cs
    AddLanguage da .dk
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage en .en
    AddLanguage eo .eo
    AddLanguage es .es
    AddLanguage et .et
    AddLanguage fr .fr
    AddLanguage he .he
    AddLanguage hr .hr
    AddLanguage it .it
    AddLanguage ja .ja
    AddLanguage ko .ko
    AddLanguage ltz .ltz
    AddLanguage nl .nl
    AddLanguage nn .nn
    AddLanguage no .no
    AddLanguage pl .po
    AddLanguage pt .pt
    AddLanguage pt-BR .pt-br
    AddLanguage ru .ru
    AddLanguage sv .sv
    AddLanguage zh-CN .zh-cn
    AddLanguage zh-TW .zh-tw
    #
    # LanguagePriority allows you to give precedence to some languages
    # in case of a tie during content negotiation.
    #
    # Just list the languages in decreasing order of preference. We have
    # more or less alphabetized them here. You probably want to change this.
    #
    LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW#
    # ForceLanguagePriority allows you to serve a result page rather than
    # MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
    # [in case no accepted languages matched the available variants]
    #
    ForceLanguagePriority Prefer Fallback#
    # Specify a default charset for all pages sent out. This is
    # always a good idea and opens the door for future internationalisation
    # of your web site, should you ever want it. Specifying it as
    # a default does little harm; as the standard dictates that a page
    # is in iso-8859-1 (latin1) unless specified otherwise i.e. you
    # are merely stating the obvious. There are also some security
    # reasons in browsers, related to javascript and URL parsing
    # which encourage you to always set a default char set.
    #
    AddDefaultCharset GB2312
    #
    # Commonly used filename extensions to character sets. You probably
    # want to avoid clashes with the language extensions, unless you
    # are good at carefully testing your setup after each change.
    # See http://www.iana.org/assignments/character-sets for the
    # official list of charset names and their respective RFCs.
    #
    AddCharset ISO-8859-1  .iso8859-1  .latin1
    AddCharset ISO-8859-2  .iso8859-2  .latin2 .cen
    AddCharset ISO-8859-3  .iso8859-3  .latin3
    AddCharset ISO-8859-4  .iso8859-4  .latin4
    AddCharset ISO-8859-5  .iso8859-5  .latin5 .cyr .iso-ru
    AddCharset ISO-8859-6  .iso8859-6  .latin6 .arb
    AddCharset ISO-8859-7  .iso8859-7  .latin7 .grk
    AddCharset ISO-8859-8  .iso8859-8  .latin8 .heb
    AddCharset ISO-8859-9  .iso8859-9  .latin9 .trk
    AddCharset ISO-2022-JP .iso2022-jp .jis
    AddCharset ISO-2022-KR .iso2022-kr .kis
    AddCharset ISO-2022-CN .iso2022-cn .cis
    AddCharset Big5        .Big5       .big5
    # For russian, more than one charset is used (depends on client, mostly):
    AddCharset WINDOWS-1251 .cp-1251   .win-1251
    AddCharset CP866       .cp866
    AddCharset KOI8-r      .koi8-r .koi8-ru
    AddCharset KOI8-ru     .koi8-uk .ua
    AddCharset ISO-10646-UCS-2 .ucs2
    AddCharset ISO-10646-UCS-4 .ucs4
    AddCharset UTF-8       .utf8# The set below does not map to a specific (iso) standard
    # but works on a fairly wide range of browsers. Note that
    # capitalization actually matters (it should not, but it
    # does for some browsers).
    #
    # See http://www.iana.org/assignments/character-sets
    # for a list of sorts. But browsers support few.
    #
    AddCharset GB2312      .gb2312 .gb 
    AddCharset utf-7       .utf7
    AddCharset utf-8       .utf8
    AddCharset big5        .big5 .b5
    AddCharset EUC-TW      .euc-tw
    AddCharset EUC-JP      .euc-jp
    AddCharset EUC-KR      .euc-kr
    AddCharset shift_jis   .sjis
    #
    # AddType allows you to add to or override the MIME configuration
    # file mime.types for specific file types.
    #
    #AddType application/x-tar .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    # Despite the name similarity, the following Add* directives have nothing
    # to do with the FancyIndexing customization directives above.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .phpphp.ini中相关内容
    ; Automatically add files before or after any PHP document.
    auto_prepend_file =
    auto_append_file =; As of 4.0b4, PHP always outputs a character encoding by default in
    ; the Content-type: header.  To disable sending of the charset, simply
    ; set it to be empty.
    ;
    ; PHP's built-in default is text/html
    :default_mimetype = "text/html"
    :default_charset = "GB2312"; Always populate the $HTTP_RAW_POST_DATA variable.
    ;always_populate_raw_post_data = On请大家一起研究,分多的是.谢谢!!
      

  9.   

    让你贴一点浏览器“源代码”,为什么就不肯呢?
    没有哪个web服务器会自动做编码转换的,最多只是提你做一下声明!
      

  10.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
    <title>安装Apache的测试页面</title>
    </head>
    <!-- Background white, links blue (unvisited), navy (visited), red
    (active) -->
    <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
    vlink="#000080" alink="#FF0000">
    <p>您能看见这个页面,说明<a
    href="http://www.apache.org/foundation/preFAQ.html">Apache web
    server</a> 已经安装成功。您可以在这个目录中增加内容,或者把这个页面替换掉。</p><hr width="50%" size="8" />
    <h2 align="center">这不是你想看见的页面吧?</h2><p>之所以会看见这个页面,是因为网站管理员改变了这个站点的设置。
    如果有疑问,请<strong>咨询维护此站点的人员。</strong>
    Apache软件基金会, 即此站点所使用的网站服务器软件的开发者,
    不负责此站点的维护工作,也无法为您解决设置上的问题。</p><hr width="50%" size="8" />
    <p>Apache <a href="../manual/">文档</a>已经包含在此发行版中。</p><p>您可以在使用Apache的网站服务器上,自由地使用下面的图片。感谢使用Apache!</p><div align="center"><img src="apache_pb.gif" alt="" /></div></body>
    </html>
      

  11.   

    这是Apache的测试页面的源代码,我直接用IP地址访问显示的是正确的,但是我将源码
    另存为ex1.php后,输入ip地址加ex1.php后,显示的就是乱码了,将浏览器字符集改为
    unicode后才显示正确.
      

  12.   


     如xuzuning(唠叨) 所说,apache并不会转码。显示出来是什么编码,那么源文件就是什么编码。欢迎页显示utf-8和要用的东西一点关系也没有。P.S. php不提倡使用apache2
      

  13.   

    P.S. php不提倡使用apache2
    哪用什么???
      

  14.   

    apache 1 系列只到我编译 4.3.2的时候,php的提示仍然写的是最好使用 1的系列
    不是我说的哦,是php.net说的
      

  15.   

    不知道楼主在什么环境下用什么浏览器?同意楼上的,在php的官方手册中确实提到了apache 1比apache 有更完善的兼容性。
      

  16.   

    到底是怎么拉?!是我没说明白吗?
    楼主,我没有要你贴出服务器上的文件,只是要你贴出“将浏览器字符集改为
    unicode后才显示正确”时浏览器的“查看源文件”中得到的代码。
      

  17.   

    在每一张PHP或 HTML网页的开头<html><head>后面加上 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" >就可以了,
    你试试吧
      

  18.   

    gb和GB一样吧,html语言是不分大小写的
      

  19.   

    一样,不过这个加 meta好像是没什么用的楼主似乎本身就是输出的utf-8meta只是给浏览器用的