给你一个成员函数:
/**** 字符集的转换函数 ****/
// added by baiqing 2003.02.18
public static String charConvert(String strSource){
if (strSource == null){
return "";
}
else{
try{
//return new String(strSource.getBytes("GB2312"), "GBK");
String str = new String(strSource.getBytes("GBK"), "GB2312");
System.out.println(str);
return str;
}
catch (Exception ex){
System.out.println(ex.toString());
return "";
}
}
}
/**** 字符集的转换函数 ****/
// added by baiqing 2003.02.18
public static String charConvert(String strSource){
if (strSource == null){
return "";
}
else{
try{
//return new String(strSource.getBytes("GB2312"), "GBK");
String str = new String(strSource.getBytes("GBK"), "GB2312");
System.out.println(str);
return str;
}
catch (Exception ex){
System.out.println(ex.toString());
return "";
}
}
}
请联系[email protected]