fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.net.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. String url1 = "https://dev/ABC/v1/XYZ?itemnumber%255Bin%255D=%255B3001%252C3005%252C202%255D&limit=2&apikey=4zVYEk2Xg8zvwYxNnW&offset=2";
  13.  
  14. System.out.println(URLDecoder.decode(url1, "UTF-8"));
  15. System.out.println(URLDecoder.decode(URLDecoder.decode(url1, "UTF-8"), "UTF-8"));
  16. }
  17. }
Success #stdin #stdout 0.13s 41000KB
stdin
Standard input is empty
stdout
https://dev/ABC/v1/XYZ?itemnumber%5Bin%5D=%5B3001%2C3005%2C202%5D&limit=2&apikey=4zVYEk2Xg8zvwYxNnW&offset=2
https://dev/ABC/v1/XYZ?itemnumber[in]=[3001,3005,202]&limit=2&apikey=4zVYEk2Xg8zvwYxNnW&offset=2