日期:2014-05-17 浏览次数:21019 次
public String convertISO8859_1ToGBK(String str) {
String returnStr = "";
if (str.startsWith("\"")) {
str = str.substring(1);
}
if (str.endsWith("\"")) {
str = str.substring(0, str.length() - 1);
}
try {
returnStr = new String(str.getBytes("ISO8859_1"), "GBK");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return returnStr;
}
System.out.println(convertISO8859_1ToGBK("\320\302\272\350\317\35086 2070W\320\266\264\254\264\254\315\274 (2).txt")); //里面的字符就是iso8859-1的