2011-09-18 50 views
5

我想在java中找到一個URL。java中的Unescape url

有沒有一些工具或庫?

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

我需要這在正常形式。

+0

可能重複http://stackoverflow.com/questions/623861/how-do-you-unescape-urls-在-JAVA) – ughoavgfhw

回答

9

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中未逸出網址嗎?](