解码java中的url

时间:2014-08-18 11:55:55

标签: java

我有一个编码的查询字符串,我不知道这是什么类型的加密...我尝试过URLdecode.decode但它不起作用。在c#中,我只使用.decode来解码此字符串,但这不起作用。谁能帮我这个?它是某种与字体相关的字符串内容。我不认为这只是UTF-8编码....字符串就像这样......

  

%u0925%u4E2D%u570B%u51FA%u81EA%u7DAD%u57FA%u767E%u79D1%uFF0C%u7531%u5605%u5168%u66F8%u5462%u7BC7%u6587%u8981%u6E05%u7406%u6216%u91CD%u5BEB% u4EE5%u7B26%u5408%u66F4%u9AD8%u8CEA%u91CF%u6A19%u6E96%u3002%u5982%u679C%u4F60%u505A%u5F97%u5230%u53EF%u6539%u5584%u4E0B%u6CE8%u610F%uFF1A%u5514%u4FC2% u83EF%u4EBA%u6C11%u5171%u548C%u53CA%u4E00%u8A5E%u53E4%u5C31%u6709%u6700%u65E9%u6307%u4F4F%u55BA%u300C%u5929%u300D%uFF08%u4E16%u754C%uFF09%u5FC3%u539F% u5730%u5E36%u8FD1%u4EE3%u4F86%u6210%u70BA%u65CF%u5BB6%u7FA9%u4E0A%u653F%u6CBB%u6982%u5FF5%u822C%u569F%u8B1B%u5E7E%u7A2E%u540C%u4F46%u76F8%u95DC%u601D% u53F2%u5B78%u89D2%u5EA6%u4E09%u7687%u4E94%u5E1D%u50B3%u8AAA%u6642%u958B%u59CB%u7D93%u6B77%u5510%u582F%u3001%u865E%u821C%u590F%u5546%u5468%u79E6%u6F22% u65B0%u6649%u5357%u5317%u671D%u968B%u5341%u5B8B%u907C%u91D1%u5143%u660E%u57CB%u7B49%u7CFB%u5217%u6B0A%u5481%u9023%u9F4A%u6574%u9AD4%u4F4D%u65BC%u6B50% u4E9E%u5927%u9678%u6771%u90E8%u592A%u5E73%u6D0B%u897F%u5CB8%u53E3%u591A%u57DF%u95CA%u4E4B /%u884C%u800C%u5B58 %u5728%u5169%u500B%u9999%u6E2F%u6FB3%u9580%u81FA%u7063%u5340%u76EE%u9304%5B%u6536%5D1%u6E90.2%u524D3456%u8A9E%u8A007%u5B97%u6559%u7DE8%u8F2F%u7528 %u6CD5%u82B1%u516B%u8A71%u89C0%u9EDE%u8B58%u5F62%u614B%u80FD%u5C0D%u7BC4%u570D%u5404%u6B63%u7D71%u6027%u5F7C%u6B64%u9593%u89E3%u73FE%u6240%u77E5%u5B57 %u300A%u5C1A%B7%u6893%u6750%u300B%u5165%u9762%u65E2%u4ED8%u8D8A%u53A5%u7586%u571F%u5148%u738B%u8086%u55F0%u9663%u542B%u53EA%u4E0D%u904E%u5DF1%u5C45 %u65B9%u7A31%u8B02%u4F62%u54CB%u8A8D%u56DB%u5206%u5225%u4FFE%u53EB%u883B%u5937%u620E%u72C4%u521D%u5B50%u8AF8%u4FAF%u7BC9%u57CE%u908A%u90CA%u9060%u91CE %u4EAC%u757F%u597D%u4F3C%u66B4%u52D5%u7576%u7136%u4EA6%u885B%u61FF%u516C%u990A%u9DB4%u797F%u4FB5%u6230%u62DB%u81F4%u6EC5%u53C3%u8003%u56E0%u662F%u52A0 %u4FEE%u98FE%u81F3%u78BA%u8868%u793A%u96A8%u767C%u5C55%u76F4%u63A5%u65B7%u64F4%u6625%u79CB%u5DF2%u9010%u6F38%u5649%u517C%u4F75%u5287%u70C8%u9032%u8DA8 %u5411Mm

1 个答案:

答案 0 :(得分:2)

使用Apache Commons库,您可以:

final String encoded; // Your string without the trailing Mm
final String replaced = encoded.replace("%", "\\");
final String decoded = StringEscapeUtils.unescapeJava(replaced);
System.out.println(decoded);