50,526
社区成员
发帖
与我相关
我的任务
分享
String s tr="\\xe7\\xba\\xbf\\xe4\\xb8\\x8b\\xe5\\xbe\\xae\\xe4\\xbf\\xa1\\xe8\\xbd\\xac\\xe8\\xb4\\xa6".replaceAll("\\\\x", "%");
System.out.println(URLDecoder.decode(str, "UTF-8")); //转中文
String str2 = URLEncoder.encode("你好", "UTF-8");
String replace = str2.toLowerCase().replace("%", "\\x");
System.out.println(replace); //转编码