http://expert.csdn.net/Expert/topic/1020/1020873.xml?temp=.1090052

解决方案 »

  1.   

    进行显式编码转换:
       String yourString ="显示的中文";
       out.println(new String(yourString.getBytes("ISO8859_1"),"GBK"));一般都可以搞定,就是太麻烦了一些,每次都要进行转换,不知有没有简单一些的方法。
      

  2.   

    String getStr(String str){
    try{
    String temp_p=str;
    byte[] temp_t=temp_p.getBytes("ISO8859-1");
    String temp=new String(temp_t);
    return temp.trim();
    }catch(Exception e)
    {
    return "null";
    }}
    用它来转换一下就可以了!
      

  3.   

    文件头:
    <%@ page contentType="text/html; charset=gb2312" %>
    可以解决显示时的问题
    写到数据库里时:
    //试试下面的每个方法,转换得到的参数!
    public static String iso8859togbk(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("ISO8859_1"), "GBK"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 

    }  public static String iso8859togb2312(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("ISO8859_1"), "gb2312"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 

    }  public static String gb2312to8859(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("gb2312"), "ISO8859_1"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 


    public static String gbkto8859(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("gbk"), "ISO8859_1"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 

      

  4.   

    zxhong(红) 说的对,我就用的这种方法!
      

  5.   

    不要这么麻烦,
    websphere里面:
     1.把LANG='zh',
     2.properties = 'GBK'
    就可以啦.
    weblogic里面:
     1. input.propoties='GB2312'
     就可以啦.tomcat如果在windows 2000中文下没问题