string str= new string("繁体".getByte[],"gb2312");
请参看string 的构造函数,它里面有字符集转换的。

解决方案 »

  1.   

    繁体转成简体:public static String big5ToChinese(String s){
      try{
         if(s==null||s.equals("")) return "";
         String newstring=null;
         newstring=new String(s.getBytes("big5"),"gb2312");
         return newstring;
        }
      catch(UnsupportedEncodingException e)
      {
      return s;
      }
      }public static String ChineseTobig5(String s){
      try{
      if(s==null||s.equals("")) return "";
      String newstring=null;
      newstring=new String(s.getBytes("gb2312"),"big5");
       return newstring;
      }
      catch(UnsupportedEncodingException e)
      {
      return s;
     }
      }
    如果您要“简体转成繁体”的话,就改变下面一行就可以了
    newstring=new String(s.getBytes("ISO8859_1"),"gb2312");也就是换个参数啦