I have a servlet that receives some parameter from the client and then does some work. And the parameter from the client is Chinese, so I often get some invalid characters in the servlet. For exmaple: If I introduce
http://localhost:8080/Servlet?q=中文&type=test
Then, in the servlet, the "type" parameter is correct (test), however the "q" parameter is incorrectly encoded, they become invalid characters that cannot be parsed.
However, if I enter the adder panel again, the URL will change to:
http://localhost:8080/Servlet?q=%D6%D0%CE%C4&type=test
Now my servlet will receive the correct "q" parameter.
What is the problem?
UPDATE
By the way, he speaks well when I submit a form with a message. When I post them in ajax, for example:
url="http://..q='中文',
xmlhttp.open("POST",url,true);
Then the server side also receives invalid characters.
, % xx, .
http://.../q=中文 ,
http://.../q=%D6%D0%CE%C4 .
"http://www.google.com.hk/search?hl=zh-CN&newwindow=1&safe=strict&q=%E4%B8%AD%E6%96%87&btnG=Google+%E6%90%9C%E7%B4%A2&aq=f&aqi=&aql=&oq=&gs_rfai=" ?
