IE browser when post submission Chinese scrambling solution

  • 2020-06-15 10:05:04
  • OfStack

The current problem is that character encoding uft-8 is configured on both the page and the server side, but there is no problem with firefox and chrome when submitting, and Chinese scrambled code does appear in ie8. The solution adopted is to transcode on the web side and then go back on the server side. Example:

Client:
 
userName = encodeURI(userName); 

post submitted

Server side:
 
response.serContentType("text/html;charset=utf-8"); 
String keyword= request.getParameter(keyword); 
keyword= java.net.URLDecoder.decode(keyword, "utf-8"); 

Related articles: