package com.grcaeup;
import java.io.UnsupportedEncodingException;
/**
* gbk转UTF-8 工具类
*
*/
public class Gbk2Utf8Utils {
public static String gbk2Utf8(String str) {
try {
String iso = new String(str.getBytes("UTF-8"), "ISO-8859-1");
String utf8 = new String(iso.getBytes("ISO-8859-1"), "UTF-8");
return utf8;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
}
gbk转UTF-8 工具类
最新推荐文章于 2018-12-14 13:31:43 发布