把“中国”二字转化为URL编码:
String decode = URLEncoder.encode("中国", "UTF-8");
System.out.println(decode);
// 输出%E4%B8%AD%E5%9B%BD
把URL编码“%E4%B8%AD%E5%9B%BD”转化为汉字:
decode = URLDecoder.decode(decode, "UTF-8");
System.out.println(decode);
// 输出 中国
2019-09-17 15:34:09
浏览 4867
随时随地看视频慕课网APP
相关课程