public class Util {
/**
* 字符集转换ISO_GBK
* @param tmp
* @return
*/
public static String swithCharISO_GBK(String tmp){
String str=null;
try {
str = new String(tmp.getBytes("iso-8859-1"),"GBK");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return str;
}
/**
* 字符集转换GBK_ISO
* @param tmp
* @return
*/
public static String swithCharGBK_ISO(String tmp){
String str=null;
try {
str = new String(tmp.getBytes("GBK"),"iso-8859-1");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return str;
}
}