String city="北京市";
        String code_1= URLEncoder.encode(city, "utf-8");
        System.out.println(code_1); 
        
        String code_2= URLEncoder.encode(code_1, "utf-8");
        System.out.println(code_2); 
        
        
        String input = "%25E5%258C%2597%25E4%25BA%25AC%25E5%25B8%2582";
        String encoding="utf-8";
        String output=URLDecoder.decode(input, encoding);        
        System.out.println(URLDecoder.decode(output, encoding)); //用正确的编码来解码

相关文章:

  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-09-21
  • 2022-12-23
猜你喜欢
  • 2021-05-13
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2021-06-18
  • 2022-12-23
  • 2021-05-25
相关资源
相似解决方案