【问题标题】:Decode url which has been encoded in javascript解码已用 javascript 编码的 url
【发布时间】:2015-03-03 22:32:27
【问题描述】:

可以在java中解码已经用javascript编码的url

js:

 params.url = encodeURIComponent(url);

有人知道正确的做法吗?

【问题讨论】:

标签: java javascript


【解决方案1】:

使用java.net.URLDecoder

但请注意,java 和 javascript 实现之间存在一些差异。

详情请看:

Difference in URL decode/encode UTF-8 between Java and JS/AS3 (bug!?)

Java equivalent to JavaScript's encodeURIComponent that produces identical output?

【讨论】:

    【解决方案2】:

    使用类URLDecoder

    您可以将它用于编码和解码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-29
      • 1970-01-01
      • 1970-01-01
      • 2015-11-06
      • 1970-01-01
      相关资源
      最近更新 更多