utf8转gb2312
2018-10-02 本文已影响65人
潇洒的夏夏
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;
}
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;
}