wangxingok(我只在乎你): 我和你的想法基本一样,我也认为是tomcat的版本问题,你所说的把“编码全部转过”是什么概念?我在论坛里也找了好多相似的问题看过,也适了一些还是不行,你有过相似的经验,你上次是怎么解决的

解决方案 »

  1.   

    在中文的地方转码
    new String((中文).getBytes(),"ISO8859_1")
      

  2.   

    public static String gbTo(String gbStr)
    {
    String str = null;
    try{
    str    = new String(gbStr.getBytes("GB2312"),"8859_1");
    }catch(Exception e){}
    return       str;
    }
    public static String toGb(String Str)
    {
    String str = null;
    try{
    str    = new String(Str.getBytes("8859_1"),"GB2312");
    }catch(Exception e){}
    return       str;
    }
      

  3.   

    是因为你是用了JB里的tomcat造成的,JB里的TOMCAT的缺省用GBK解码,而单独的tomcat缺省使用iso88859-1解码,这是造成这种情况的根本原因,JB里的tomcat被改过
      

  4.   

    tonysnss(智诚) : 我觉得你说的很对,我也认为是jb的原因,但是我要单独的tomcat下做修改呢?大虾,你给我点具体的解决办法吧!