开发者

Unescape url in java

开发者 https://www.devze.com 2023-04-06 04:37 出处:网络
I am trying to unescape a URL in java. Is there some tool or library for that ? example : filter=Screen+Refresh+Rate%7C120HZ%5EScreen+Size%7C37+in.+to+42+in.

I am trying to unescape a URL in java.

Is there some tool or library for that ?

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

I need this in the 开发者_如何学Pythonnormal form.


URLDecoder.decode(String s,"utf-8") will work if s is encoded in 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);

Output

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

精彩评论

暂无评论...
验证码 换一张
取 消