Home > Web Front-end > JS Tutorial > The solution to the Chinese garbled value passed in js url_javascript skills

The solution to the Chinese garbled value passed in js url_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 18:41:33
Original
1100 people have browsed it

In websphere, url=encodeURI(encodeURI(url)) is used; //Used encodeURI twice and the test was successful. The first conversion was not attempted.
Processing method one.
js program code: url=encodeURI(url); note that it is the entire URL
Server-side code: String linename = new String(request.getParameter("name").getBytes("ISO-8859-1") ,"UTF-8");
Processing method two.
js: var url="name=" name;
url=encodeURI(encodeURI(url)); //Used 2 times encodeURI
window.location = "/inner/line/ line.jsp?" url;
Server-side code:
String linename = request.getParameter(name);
//java: Character decoding
linename = java.net.URLDecoder.decode(linename , "UTF-8");

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template