Java 处理 \x 开头的编码

2,340 阅读1分钟
@Test
public void decodeX() throws UnsupportedEncodingException {
    String s = "\\x22\\xE5\\x93\\x88\\xE5\\x93\\x88\\x22";
    String s1 = s.replaceAll("\\\\x", "%");
    String decode = URLDecoder.decode(s1, "utf-8");
    System.out.println(decode);
}

感谢 Vert.x中国用户组(515203212) 的 512058895 大神