If the Chinese parameters of the URL are garbled, you can try:
Method 1: (java) The first page
Use when splicing URL parameters :URLEncoder.encode(parameter, "UTF-8")
The second page gets the parameter from the request
Value=new String(request.getParameter(parameter name).getBytes( "iso-8859-1"),"utf-8"); shopName = URLDecoder.decode(value, "UTF-8");
Method 2 (JavaScript)
Use directly encodeURI (Chinese)
Then you can get it directly in the background
For more java knowledge, please pay attention tojava basic tutorial.
The above is the detailed content of Java url parameters are garbled. For more information, please follow other related articles on the PHP Chinese website!