JAVA将Unicode转换成GBK字符集

/**

  • JAVA将Unicode转换成GBK字符集

*

  • @param input 待转换字符串
  • @return 转换完成字符串

*/
public static String UnicodeToGB(String input) throws UnsupportedEncodingException {
if (isEmpty(input)) {
return "";
}
else {
String s1;
s1 = new String(input.getBytes("ISO8859_1"), "GBK");
return s1;
}
}

评论

暂无评论