我们在web应用开发过程中经常遇到输出某种编码的

12 查阅
我们在web应用开发过程中经常遇到输出某种编码的字符,如iso8859-1 等,如何输出一个某种编码的字符串?

参考答案:

正确答案:

\r\n

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.p

字符串