JAVA URL 转码和解码

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/inforstack/article/details/79260115
String str = URLEncoder.encode("中国", "utf-8");
System.out.println(str);
// 解码
String str1 = URLDecoder.decode(str, "UTF-8");
System.out.println(str1);
%E4%B8%AD%E5%9B%BD
中国


猜你喜欢

转载自blog.csdn.net/inforstack/article/details/79260115