在使用URLDecoder对字符串进行解码的时候 报以下异常信息:

Exception in thread "main" java.lang.IllegalArgumentException: URLDecoder: Incomplete trailing escape (%) pattern

原因是字符串中包含有%字符

解决方法如下 example:

String str = "hello该字符串中包含%";System.out.println(URLDecoder.decode(str.replaceAll("%", "%25"), "UTF-8"));

常见URL编码表:

URLDecoder Incomplete trailing escape pattern

           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-17
  • 2021-08-03
  • 2021-07-05
  • 2021-11-20
  • 2021-08-11
  • 2022-01-22
相关资源
相似解决方案