jsp 超链接传递中文乱码

如题所述

比如说你现在要把<input type = "text" name = "username">文本框中的值传过去的话<a href = "javascript:src(username.value)">传值</a><script>function src(oop){window.location = "b.jsp?str="+oop; }<script>接受时String sc = request.getParameter("str");
sc = new String(sc.getBytes("ISO-8859-1"),"UTF-8");
温馨提示:内容为网友见解,仅供参考
第1个回答  2013-09-12
---------传递java.net.URLEncoder.encode("中文") ;
---------接收

String sc = request.getParameter("content");
sc = new String(sc.getBytes("iso-8859-1"),"gb2312");
相似回答