public final class URLCodes extends Object
| 构造器和说明 |
|---|
URLCodes() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
decodeURI(String url) |
static String |
decodeURI(String url,
String charset)
相当于javascript的decodeURI
|
static String |
decodeURIComponent(String url) |
static String |
decodeURIComponent(String url,
String charset)
相当于javascript中的decodeURIComponent
|
static String |
encodeURI(String url) |
static String |
encodeURI(String url,
String charset)
相当于javascript中的encodeURI
不会被此方法编码的字符:!
|
static String |
encodeURIComponent(String url) |
static String |
encodeURIComponent(String url,
String charset)
相当于javascript中的encodeURIComponent
不会被此方法编码的字符:!
|
public static String encodeURI(String url, String charset)
相当于javascript中的encodeURI
不会被此方法编码的字符:! @ # $& * ( ) = : / ; ? + '
encodeURI("http://www.oschina.net/search?scope=bbs&q=C语言", "UTF-8") -> http://www.oschina.net/search?scope=bbs&q=C%E8%AF%AD%E8%A8%80
url - the url stringcharset - the charsetpublic static String decodeURI(String url, String charset)
url - the url stringcharset - the charsetpublic static String encodeURIComponent(String url, String charset)
相当于javascript中的encodeURIComponent
不会被此方法编码的字符:! * ( )
encodeURIComponent("http://www.oschina.net/search?scope=bbs&q=C语言", "UTF-8") -> http%3A%2F%2Fwww.oschina.net%2Fsearch%3Fscope%3Dbbs%26q%3DC%E8%AF%AD%E8%A8%80
url - the uri stringcharset - the charsetCopyright © 2023. All rights reserved.