GET method URL to pass Chinese parameter confusion code solution
- 2020-06-23 01:41:31
- OfStack
1. Code your URL on the page
Use --encodeURI(the value of the Chinese parameter you want to use) such as:... ? username"+encodeURI(" sugar ")
2. Receive the Chinese parameter in the background by decoding
Use --String name = new String(request.getParameter ("username ").getBytes("iso8859-1")," ES19en-8 ")
3. It is best not to pass Chinese parameters in URL
Use --encodeURI(the value of the Chinese parameter you want to use) such as:... ? username"+encodeURI(" sugar ")
2. Receive the Chinese parameter in the background by decoding
Use --String name = new String(request.getParameter ("username ").getBytes("iso8859-1")," ES19en-8 ")
3. It is best not to pass Chinese parameters in URL