ITeye博客

输出某种编码的字符串

icyheart · 2008-10-15 09:22 · J2SE · Markdown

Public String translate (String str) {
String tempStr = "";
try {
tempStr = new String(str.getBytes("ISO-8859-1"), "GBK");
tempStr = tempStr.trim();
}
catch (Exception e) {
System.err.println(e.getMessage());
}
return tempStr;
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。