Decode Json urls
I'm manually parsing Json objects using java and I have a problem with urls.
They currently look like this:
http:\/\/a3.sphotos.ak.fbcdn.net\/hphotos-ak-ash4\/...
and I was wondering how to开发者_如何学运维 decode them into a normal form that I can further use, like this:
http://a3.sphotos.ak.fbcdn.net//hphotos-ak-ash4//...
It's not just the slashes that cause this problem, so simply searching for them is not a solution. I'm searching for a standard method from the jdk that could easily accomplish this.
Unfortunately I have know idea what the encoding is called, so I can't be more specific in what I want to know.
Looks like you should try and use the answer from here:
unEscape JavaScript escaped value in JAVA
There seems to be an unescape function. I have used that before in javascript (unescape) to help with the same issue. Looks like Java has a similar function.
http://commons.apache.org/lang/api-release/org/apache/commons/lang/StringEscapeUtils.html
精彩评论