
import java.io.UnsupportedEncodingException;
public class Bean {
// 将GBK转换为Unicode的代码
public String GBK2UNI(String s) throws UnsupportedEncodingException {
String temp = s;
temp = new String(s.getBytes("GBK"), "ISO8859_1");
return temp;
}
// 将Unicode转换为GBK的代码
public String UNI2GBK(String s) throws UnsupportedEncodingException {
String temp = s;
temp = new String(s.getBytes("ISO8859_1"), "GBK");
return temp;
}
}




by: 发表于:2017-12-29 10:50:41 顶(0) | 踩(1) 回复
??
回复评论