java url编码
在 Java 中,对 URL编码的内容进行URL解码可以使用 java.net.URLDecoder 类。这个类提供了静态方法 decode,可以将 URL编码的字符串转换为普通字符串。Java的URL编码
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
public class UrlDecodeExample {
public static void main(String[] args) {
// URL编码的字符串
String encodedUrl = "Hello%20World%21%20%40%20Java%20URL%20Decoding";
try {
// 使用Java URLDecoder 进行URL解码
String decodedUrl = URLDecoder.decode(encodedUrl, "UTF-8");
// 输出结果
System.out.println("Decoded URL: " + decodedUrl);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}
URL Decode 在线解码工具
这是一个简单易用的在线URL解码工具,就是简单快捷地进行各种字符的URL解码或编码操作。您的数据可以轻松地编码为 URL 编码,也可以解码为人类可理解的格式。UrlEncode是为了将字符转换为可在URL中安全传输的格式的编码方法。它将非字母数字字符转换为百分号(%)后跟两位十六进制数。UrlDecode就是将Url编码后的转换为编码前的字符。
复制成功
UrlEncode特殊符号编码表
符号 | 编码 |
---|---|
空格 | %20 |
! | %21 |
# | %23 |
$ | %24 |
& | %26 |
' | %27 |
( | %28 |
) | %29 |
* | %2A |
+ | %2B |
, | %2C |
/ | %2F |
: | %3A |
; | %3B |
= | %3D |
? | %3F |
@ | %40 |
[ | %5B |
] | %5D |