url***********?cname=中文
跳转到url所指的页面通过${param.cname},中文变成乱码。
解决方案:<% String x=request.getParameter("cname");x=new String(x.getBytes("iso-8859-1"),"utf-8");out.print(x);%>
本文介绍了一种解决URL参数中中文字符出现乱码的问题的方法。通过将接收到的参数从iso-8859-1编码转换为utf-8编码,可以有效避免乱码情况的发生。
url***********?cname=中文
跳转到url所指的页面通过${param.cname},中文变成乱码。
解决方案:<% String x=request.getParameter("cname");x=new String(x.getBytes("iso-8859-1"),"utf-8");out.print(x);%>
617

被折叠的 条评论
为什么被折叠?