1. encodeURI(), and encodeURIComponent() encode characters.
2. decodeURI(), and decodeURIComponent() decode the corresponding encoded characters.
3. The encodeURI method does not encode ASCII letters and numbers, nor does it encode these ASCII punctuation marks: - _ . ! ~ * ' ( ) 。
The purpose of this method is to fully encode the URI, so the encodeURI() function will not escape the following ASCII punctuation marks that have special meanings in URIs: ; /?:@&=+$, #
4. The encodeURIComponent() method does not encode ASCII letters and numbers, nor does it encode these ASCII punctuation marks: - _ . ! ~ * ' ( ) 。
Other characters (e.g. :; /?:@&=+$,# these punctuation marks used to separate URI components), are all replaced by one or more hexadecimal escape sequences.
5. Image explanation, the role of encodeURI on full-width Japanese and Korean Chinese characters. Instead of handling special characters in URLs, .encodeURIComponent() creates special characters in URLs and converts them into corresponding ASCII code
6. These methods are Javascrip{filtering}t functions, that is, they can only be used in Javascrip{filtering}t.
7. If you do not use decodeURI() and decodeURIComponent() on the service side, you can use fw = new String(fw.getBytes("ISO-8859-1"), "UTF-8"); Java syntax, slightly different in other languages. |