ArticleDirectory
- Syntax
- Return Value
- Description
Recently, I am bored and found that garbled characters may occur when the URL in UTF-8 encoding format passes an odd number of Chinese characters on the JSP page. There are some solutions for Google on the Internet.
Because I put the URL together in Javascript, it's okay to use encodeuricomponent.
The specific usage is as follows (copy ):
Definition and usage
The encodeuricomponent () function can encode a string as a URI component.
Syntax
Encodeuricomponent (uristring)
| Parameters |
Description |
| Uristring |
Required. A string containing the URI component or other text to be encoded. |
Return Value
A copy of uristring, some of which will be replaced by the hexadecimal escape sequence.
Description
This method does not encode ASCII letters and numbers, and does not encode these ASCII punctuation marks :-_.! ~ *'().
Other characters (such :;/? : @ & =+ $, # The punctuation marks used to separate URI components) are all replaced by one or more hexadecimal escape sequences.