/**
* 字符串转换编码
* @author Administrator
*
*/
public class StringEncode {
/**
* 将ISO-8859-1编码字符串转换UTF-8编码
* @param param
* @return
*/
public static String toUTF8(String param) {
if (param == null) {
return null;
} else {
try {
param = new String(param.getBytes("ISO-8859-1"), "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return param;
}
}
return param;
}
}
相关文章
- python打开gz文件_Python(Python2、Python3)读取gzip(.gz)文件中utf8(utf-8)编码字符串
- Python:UTF-8编码转换成GBK编码
- 将json字符串转化成Base64编码(重点)
- C#将中文转换成utf-8编码
- 将powershell的编码默认改为UTF-8
- 将iso-8859-1编码的字符串转换成utf-8
- utf-8 编码 转换 汉字 字符集
- new String(getBytes(ISO-8859-1),UTF-8)中文编码避免乱码
- MySQL数据库从GBK转换到UTF-8最简单解决方案(也适用于其它编码转换)
- JavaScript中字符串与Unicode编码互相转换的实现方法