String a=request.getParamter("aaa","ISO_8859_1"); ================================================================两个参数不行。An error occurred at line: 10 in the jsp file: /bbs/test2.jsp Generated servlet error: The method getParameter(String) in the type ServletRequest is not applicable for the arguments (String, String)
================================================================两个参数不行。An error occurred at line: 10 in the jsp file: /bbs/test2.jsp
Generated servlet error:
The method getParameter(String) in the type ServletRequest is not applicable for the arguments (String, String)
用<% request.setCharacterEncoding("gbk"); %>则也不能正确显示“——”(汉字可以正确显示了)。现在数据库读取仍然不能正确显示。用“.getBytes("gb2312")”全部字符都是乱码,用.getBytes("ISO8859-1")就“——”乱码。
(yangmowei(薇薇) ( ) 信誉:100 Blog strName=new String(strName.getBytes("GB2312"),"iso8859-1");)=====================================================================
我的写法跟她的不一样。
=new String(str.getBytes("iso8859-1"),"GB2312");意思是,把MySQL读出来的iso8859-1编码的字符以GB2312编码赋给新建的字符串?。谢谢大家,谢谢yangmowei。散分.....