js 传值乱码问题

======方法1===================

1.jsp

 

 <script type="text/javascript">

         var aa= encodeURI("d地理课");

         window.open("2.jsp?aa="+aa,"","");

 

 </script>

 

2.jsp

 

    处理办法:

                 <%=new String(request.getParameter("matrixModelNames").getBytes("iso-8859-1"), "UTF-8") %>

 

 

======方法2===================

1.jsp

    shi=encodeURI(shi);
    shi=encodeURI(shi);

 

2.jsp

   String shi=request.getParameter("shi");
   shi = java.net.URLDecoder.decode(shi, "utf-8");

你可能感兴趣的:(JavaScript,jsp,.net)