java - 在 java 中取消转义 url

标签 java url

我正在尝试在 java 中对 URL 进行转义。

是否有相应的工具或库?

example : filter=Screen+Refresh+Rate%7C120HZ%5EScreen+Size%7C37+in.+to+42+in.

我需要正常形式的这个。

最佳答案

URLDecoder.decode(String s,"utf-8")如果 s 编码在 application/x-www-form-urlencoded 中,将起作用.

String s = URLDecoder.decode("filter=Screen+Refresh+Rate%7C120HZ%5EScreen+Size%7C37+in.+to+42+in.", "utf-8");
System.out.println(s);

输出

filter=Screen Refresh Rate|120HZ^Screen Size|37 in. to 42 in.

关于java - 在 java 中取消转义 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7461631/

相关文章:

java - 如何将 Eclipse 项目设置为只读?

regex - 如何使用Regex(Google Analytics(分析))排除特定的URL路径?

python - Django - 按钮网址

java - JAR 中资源的 URL

Ruby:如何用方括号 [ 和 ] 转义 url?

java - Java 中的 Sip URI 验证

c# - 从应用程序构建操作系统

java - 在设备上运行黑莓应用程序 'attempts to access a secure api'

java - Selenium 等待 jQuery.Masonry

url - 如何将查询参数修改为路径文件夹名称?