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;
}
}
看下面两个帖子
http://www.zeali.net/entry/19http://topic.csdn.net/t/20030728/11/2079618.html
http://download.csdn.net/source/727562
我写的一个中文 简体-繁体 互相转换的JAVA工具(*.jar文件)
内存消耗不会超过60K。
1S能转换30W汉字。内部附有测试用例 和 源代码 , 帮助文档 。