摘要:
当request对象获取客户提交的汉字字符时,会出现乱码的问题,处理情况如下: 1.将获取的字符串用ISO-8859-1进行编码,并将编码保存到字节数组中,然后将这个数组转化为字符串对象即可。 <% String str = request.getParameter("username") ; byte[] c =str.getBytes("ISO-8859-1") ; str = new String(c) ;%> 2.将ISO-8859-1转换为GBK编码格式,或者将GBK转换为ISO-8859-1格式//第一种转换str1 = new 阅读全文