public class UriUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
encodeUriComponent(String uriComponent)
Encode a URI component by replacing reserved characters by one, two, three, or four escape
sequences representing the UTF-8 encoding of the character.
|
public static String encodeUriComponent(String uriComponent)
Encode a URI component by replacing reserved characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character. In contrast to RFC 3986, which treats ! ' ( ) * as reserved, the following characters are unreserved: alphabetic, decimal digits, - _ . ! ~ * ' ( )
This method behaves like the JavaScript global function encodeURIComponent, with the exception that a surrogate which is not part of a high-low pair won't throw an exception.uriComponent
- the URI component to encodeCopyright © 2019 Communote team. All rights reserved.