There is garbled when the URL is transmitted.

xiaoxiao2021-03-06  38

You can use it when you use the URL delivery parameter. Java.Net.urlencoder.Encode ("Test", "UTF-8")

Java.net.urdecoder.Decode (Request1 ")," UTF-8 ")," UTF-8 ") Your usage is definitely a problem for you 1.jsp: <% string param =" Chinese "; param = java.net.urlencoder.Encode (param);%> Go

2.jsp: <% @ Page ContentType = "text / html; charset = GB2312"%>

<% String param = request.getParameter ("param"); ​​param = java.net.urdecoder.decode (param);%>

<% = "Param:" param%>

2.JSP replacement: <% @ page contenttype = "text / html; charSet = GB2312"%>

<% String param = request.getParameter ("param"); ​​param = java.net.urdecoder.decode (param); param = new string (param.getbytes ("8859_1"), "GB2312");%>

<% = "Param:" PARAM%> ------------------------------------- -----------------------------

转载请注明原文地址:https://www.9cbs.com/read-69331.html

New Post(0)