URLDecoder: Illegal hex characters in escape (%) pattern - negative value

1、前提:

使用URLDecoder.decode(“字符串”“utf-8”);进行解码出现上述问题

2、原因:

字符串的内容出现%后不是一个16进制的数(即从0——FF)

3、解决方法:

检查传入的字符看是否%后有不是16进制的数

补充:

(1)原码

URLDecoder: Illegal hex characters in escape (%) pattern - negative value

(2)16进制表

URLDecoder: Illegal hex characters in escape (%) pattern - negative value