To import a jar package:
Import java.net.*;
Convert kanji into 16 Unicode form:
String xw= "News Center";
String Name=urlencoder.encode (XW, "utf-8");
Converts a 16-binary Unicode form string to a Chinese character:
Urldecoder.decode ("%e6%96%b0%e9%97%bb%e4%b8%ad%e5%bf%83", "utf-8");
Note: When jumping to page B from a (UTF-8) page: Parameter name with 16 binary parameter value, used in page B, Request.getparameter () gets the parameter is garbled. You cannot use Urldecoder.decode (name, "Utf-8") or access the "News Center";
Add:
on page A:
<%
String xw= "News Center";
String Name=urlencoder.encode (XW, "utf-8");
Request.setparameter ("name", "name");%>
In the B page:
<%
String Xw=urldecoder.decode (New String (Request.getparameter ("name"). GetBytes ("Iso-8859-1"), "Utf-8"), "Utf-8"); > So there will be no garbled.
Chinese characters in URL parameters converted to 16 Unicode form