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;
 }
  }
试试看看好用吗?

解决方案 »

  1.   

    谢谢斑竹了!我现在还有一个问题请教你:
       1、我从数据库中随机取的汉字,我该如何判断它是繁体的还是简体的。
       2、我能不能用下面的方法来判断一个不明的电脑用的是那种语言?
                
             String country = System.getPorperty("user.country");
             if(country.equals("CN"){
                  说明该系统是简体的;   
             }
             else if(country.equals("TW")||country.equals("HK")){
                  说明该系统是简体的;     
             }
      

  2.   

    http://www.csdn.net/develop/read_article.asp?id=10961
    http://www.csdn.net/develop/read_article.asp?id=10962