不好意思,再次更正: 在linux(RedHat9)环境下: %C7%E0%B5%BA在linux(RedHat8)环境下: %3F%3F之后进行 tmpKeyword = new String(tmpKeyword.getBytes("ISO-8859-1"),"GBK"); (换成:tmpKeyword = new String(tmpKeyword.getBytes("ISO-8859-1"),"gb2312");结果也是一样的) 处理。在linux(RedHat9)环境下: 青岛在linux(RedHat8)环境下: ?? 是在linux(RedHat8)环境下不正确。
但是表单提交的中文字符通过: tmpKeyword = new String(tmpKeyword.getBytes("ISO-8859-1"),"GBK"); 或:tmpKeyword = new String(tmpKeyword.getBytes("ISO-8859-1"),"gb2312");都能够正确显示啊!
估计是字符集的问题,试试指定字符集: public static String encode(String s,String enc)
在linux(RedHat9)环境下:
%C7%E0%B5%BA在linux(RedHat8)环境下:
%3F%3F之后进行
tmpKeyword = new String(tmpKeyword.getBytes("ISO-8859-1"),"GBK");
(换成:tmpKeyword = new String(tmpKeyword.getBytes("ISO-8859-1"),"gb2312");结果也是一样的)
处理。在linux(RedHat9)环境下:
青岛在linux(RedHat8)环境下:
??
是在linux(RedHat8)环境下不正确。
tmpKeyword = new String(tmpKeyword.getBytes("ISO-8859-1"),"GBK");
或:tmpKeyword = new String(tmpKeyword.getBytes("ISO-8859-1"),"gb2312");都能够正确显示啊!
public static String encode(String s,String enc)
tmpKeyword=new String(tmpKeyword.getBytes("iso-8859-1"),"utf-8")