Java代码处理URL转码
2022-01-07 本文已影响0人
AC编程
一、URL特殊符号及对应的编码

二、解码代码
String encode = "Image/2021/7/3/1627455105995/nanhai%402x.png";
try{
String sourceKey = URLDecoder.decode(encode, "UTF-8");
//Image/2021/7/3/1627455105995/nanhai@2x.png
System.out.println(sourceKey);
}catch (Exception e){
e.printStackTrace();
}