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;
}
}
试试看看好用吗?
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、我从数据库中随机取的汉字,我该如何判断它是繁体的还是简体的。
2、我能不能用下面的方法来判断一个不明的电脑用的是那种语言?
String country = System.getPorperty("user.country");
if(country.equals("CN"){
说明该系统是简体的;
}
else if(country.equals("TW")||country.equals("HK")){
说明该系统是简体的;
}
http://www.csdn.net/develop/read_article.asp?id=10962