package com.util;
import java.io.UnsupportedEncodingException;
/**
* 工具类
* @author Administrator
*
*/
public class CommonUtils {
/**
* 转换编码 iso8859-1 为 utf-8
* @param str
* @return
*/
public static String changeUTF(String str) {
String newStr = null;
try {
newStr = new String(str.getBytes("iso8859-1"),"utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return newStr;
}
}
工具类 编码转换
最新推荐文章于 2023-03-08 18:17:32 发布