5

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 normal form.

1

1 Answer 1

9

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.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.