试试response.setContentType("text/html; charset=gb2312");

解决方案 »

  1.   

    在sevlet里已经有response.setContentType("text/html;charset=gb2312");这句了,但还是不行
      

  2.   

    试试new String(str.getBytes("iso-8859-1"),"GBK"));
      

  3.   

    //这个一定行!public String FormatConvert(String from) {
    try{
    String temp_p=from;
    byte[] temp_t=temp_p.getBytes("gb2312");
    String temp=new String(temp_t);
    return temp;
    }catch(Exception e){}
    return null;
    }
      

  4.   

    也是一样不行,我把bean写成new String(fileName.getBytes("GBK"),"iso-8859-1");,然后把servlet里改为response.setContentType("text/html"),在网页里out.println就正常了,但是在System.out.println就还是一样错误,究竟问题是在那里呢?
      

  5.   

    to:swingcoder(swingcoder)
    你说的这个我也试了,还是不行,TOMCAT中文支持怎么这么差呀,我在WEBLOGIC里就没有这样的问题
      

  6.   

    设置一下操作系统的locale试试
    set LANG=zh_CN
    or
    export LANG=zh_CN
      

  7.   

    猜测是你的cmd窗口有问题,你应该是通过运行cmd命令打开的吧,或者是通过直接点击.bat打开的,这样可能就会有问题,你是着从附件里的打开cmd窗口试试,另外,系统的locale和language也最好设成中文。
      

  8.   

    请问在那里设置系统的locale和language???我的是win2000