0

I have a client API call that I need to make from a Java code.

For that I need to pass in a secret code for authentication.

I have the code generation logic with me but in JavaScript.

I am stuck trying to replicate this function.

unescape(encodeURIComponent(str))

Could someone help me out, how can I create this in Java.

I tried to use

`URLDecoder.decode(URLEncoder.encode(str, "UTF-8"), "UTF-8")`

But it is not giving me the same result.

prat desh
  • 31
  • 2
  • https://stackoverflow.com/questions/607176/java-equivalent-to-javascripts-encodeuricomponent-that-produces-identical-outpu – epascarello Dec 14 '21 at 14:40
  • https://stackoverflow.com/questions/25298063/how-to-get-java-to-match-javascript-encodeuricomponent-method/25298843 – epascarello Dec 14 '21 at 14:41

0 Answers0