代码很简单,平时却没怎么注意过。
public static String gb2ISO(String str)
{
try
{
if(str != null)
str = new String(str.getBytes("GB2312"), "ISO-8859-1");
}
catch(Exception e)
{
e.printStackTrace();
}
return str;
}