For the encoding in the URL, we can use these two functions for processing:
Java.net. urlencoder. encode (STR, "utf8 ");
Java.net. urldecoder. Decode ("% E4 % B8 % 8d % E5 % ad % 95", "UTF-8 ");
These two functions encode and decode the URL respectively. They always think that any encoding will be the same string containing a lot of % numbers after URL transcoding, and then write an instance, only when you know that you are mentally handicapped;
We can encode the code into UTF-8, GBK, iso-8859-1 and other formats of URL code; that is:
Java.net. urlencoder. encode (STR, "utf8 ");
When we perform reverse transcoding, we must know the encoding format containing the "%" sign, and then pass this parameter to decode; that is:
Java.net. urldecoder. Decode ("% E4 % B8 % 8d % E5 % ad % 95", "UTF-8 ");
This is a lesson for me, but I can understand it. Mark it in the log;