解码HTML返回JSON响应 - 机器人机器人、HTML、JSON

2023-09-06 14:13:25 作者:。没说要在乎你

我收到下面的连接codeD HTML作为一个JSON响应,不知道如何去code在正常的HTML字符串,它是由一种方式阿克尔标签。

I am getting following encoded html as a json response and has no idea how to decode it to normal html string, which is an achor tag by the way.

x3ca hrefx3dx22http:\/\/wordnetweb.princeton.edu\/perl\/webwn?sx3dstrandx22x3ehttp:\/\/wordnetweb.princeton.edu\/perl\/webwn?sx3dstrandx3c\/ax3e

我已经试过java.net.UrlDe coder.de code,而不an​​yluck。

I have tried java.net.UrlDecoder.decode without anyluck.

推荐答案

这不是我以前见过的编码,但它看起来像XYZ(其中Y和Z是十六进制数字 [0-9A -f] )的意思是的ASCII code是0xYZ字符。我不知道如何字母x本身是连接codeD,所以我会建议试图找出。但你可以做一个查找和正则表达式 X更换([0-9A-F] {2}),通过获取再由psented $ P $整数这两个十六进制数字,然后将其转换成一字符(或类似的东西来表示)。

That's not an encoding I've seen before, but it looks like xYZ (where Y and Z are hex digits [0-9a-f]) means "the character whose ascii code is 0xYZ". I'm not sure how the letter x itself would be encoded, so I would recommend trying to find out. But then you can just do a find and replace on the regex x([0-9a-f]{2}), by getting the integer represented by the two hex numbers, and then casting it to a char (or something similar to that).

然后也,它看起来像斜线(和其他字符?看看你是否可以找到...)总是在他们面前一个反斜杠,这样做的另一个查找和替换为。

Then also, it looks like slashes (and other characters? See if you can find out...) always have a backslash in front of them, so do another find-and-replace for that.