Reputation: 9986
It's possible to decode url in java which has been encoded in javascript
js:
params.url = encodeURIComponent(url);
Does anyone know the correct way of doing this?
Upvotes: 0
Views: 148
Reputation: 2647
Use the class URLDecoder
You can you use it for both encoding and decoding.
Upvotes: 1
Reputation: 115328
Use java.net.URLDecoder
.
But pay attention that there are several differences between java and javascript implementations.
For details take a look on:
Difference in URL decode/encode UTF-8 between Java and JS/AS3 (bug!?)
Java equivalent to JavaScript's encodeURIComponent that produces identical output?
Upvotes: 4