解码Json网址 [英] Decode Json urls

查看:120
本文介绍了解码Json网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Java手动解析Json对象,但网址出现问题.

I'm manually parsing Json objects using java and I have a problem with urls.

它们当前如下所示:

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//...

不仅仅是斜杠会导致此问题,因此仅搜索斜杠不是解决方案. 我正在从jdk中搜索可以轻松实现此目标的标准方法.

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:

在Java中取消转义JavaScript转义的值

似乎有一个unescape函数.我以前在javascript(unescape)中使用过它来帮助解决同一问题.看起来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

这篇关于解码Json网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆