url中的20%、22%、26%、28%、29%怎么解析还原成真实的字符

程序对url解码:

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

String deurl = URLDecoder.decode(url,"UTF-8");

必须加编码UTF-8或者正文的编码GB2312

否则就会提示不推荐使用

The method decode(String) from the type URLDecoder is deprecated

,decoder中间会被画一条横线。
--------------------- 
作者:ispotu 
来源:CSDN 
原文:https://blog.csdn.net/superit401/article/details/78052965 
版权声明:本文为博主原创文章,转载请附上博文链接!

发布了36 篇原创文章 · 获赞 161 · 访问量 48万+

猜你喜欢

转载自blog.csdn.net/weixin_42476601/article/details/89113857