服务器端:
String encodeStr = URLEncoder.encode(“中国”, “utf-8”);
System.out.println(“处理后:” + encodeStr);
//处理后:%E4%B8%AD%E5%9B%BD
客户端:
String decodeStr = URLDecoder.decode(encodeStr, “utf-8”);
System.out.println(“解码:” + decodeStr);
//解码:中国
作者:my_worldlet
来源:优快云
原文:https://blog.youkuaiyun.com/my_worldlet/article/details/51647285
版权声明:本文为博主原创文章,转载请附上博文链接!