How to solve the problem of Chinese garbled characters

Description of the problem: Chinese garbled characters

1. Request

1.get

1.1 Submit the form in the get method,
and re-encode the received parameters:

String str = new String(str.getBytes("ISO-8859-1"),"UTF-8");


1.2 URL splicing parameters, browser method:

The front-end and back-end of the project are separated, the front-end submits data through the interface, receives it as garbled code, gets submitted, and the parameters are translated by HTTP
URLDecoder.decode(str,"UTF-8")




Blog reference:
Summary of methods for solving Chinese garbled characters in Java Web projects
HttpServletRequest

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326943763&siteId=291194637