First, the recommended solution:
EncodeURI (encodeURI(” Chinese to encode “)); urldecoder.decode (request.getParameter(corresponding field name), “UTF-8”);
Method 1: The front-end uses encodeURI to encode Chinese, and the background server decodes it and passes: GetBytes (“ISO8859_1″),”UTF-8″). This can only be converted if the server is using ISO8859_1 encoding, if not, there is nothing left to do. URIEncoding=” utF-8 “in tomcat server.xml, save the string encoding conversion. But if the server is redeployed one day and the developer forgets about it, or a different developer redeploys it, that’s another problem.
In summary, recommend the one-size-fits-all solution above.