Some symbols cannot be passed directly in the URL, and if you want to pass these special symbols in the URL, they will be encoded. The encoded format is: The ASCII code of the% plus character, which is a percent percent, followed by the ASCII (16-binary) code value of the corresponding character. For example, the encoded value of a space is "%20".
If you do not use escape characters, these encodings are treated as special characters defined in the URL.
Some URL special symbols and coded hexadecimal values are listed in the following table
1.+ the + sign in the URL indicates a space%2b
2. Spaces in the space URL can be used with the + number or code%20
3./separate directories and subdirectories%2f
6.} Separating the actual URLs and parameters%3f
5.% Specify special characters%25
6.# represents a bookmark%23
7.& the delimiter between the parameters specified in the URL%26
8.= the value of the specified parameter in the URL%3d
You can use the JS encoding method:
1. Escape-encodes the specified string using the ISO Latin character set. Characters that are not encoded by this method: @ */+
2. encodeURI-The string that converts the URI string into an escape format using the UTF-8 encoding format is not encoded by this method:! @ # $& * () =:/;? +
3. encodeURIComponent-Converts the URI string into an escape format using the UTF-8 encoding format. Characters that will not be encoded by this method:! * ( ) ‘
Article Source:
http://czy4411741.blog.163.com/blog/static/34203127200991804738266/
Cannot have special characters and processing scheme in URL parameter