用下面的方法转了,还是不行。
String chs=”中文”;
byte[] bchs=chs.getBytes();
chs = new String(bchs,”8859_1”);不知道下面的方法行不行:http://www.neweasier.com/article/2002-08-07/1028722985.html 试了再回来。

解决方案 »

  1.   

    String username = new String(rs.getString("username").getBytes("iso8859_1"),"GBK");取出来后,转一下就可以了呀,
      

  2.   

    存入数据进行一次转码,读出后再进行一次转码。
    public  static  String  UnicodeToChinese(String  s){  
       try{  
             if(s==null  ¦  ¦s.equals(""))  return  "";  
             String  newstring=null;  
             newstring=new  String(s.getBytes("ISO8859_1"),"gb2312");  
             return  newstring;  
           }  
       catch(UnsupportedEncodingException  e)  
       {  
       return  s;  
       }  
       }  
     
    public  static  String  ChineseToUnicode(String  s){  
       try{  
       if(s==null  ¦  ¦s.equals(""))  return  "";  
       String  newstring=null;  
       newstring=new  String(s.getBytes("gb2312"),"ISO8859_1");  
         return  newstring;  
       }  
       catch(UnsupportedEncodingException  e)  
       {  
       return  s;  
     }  
       }