java.net.URLEncode编码 与 URLDecode解码问题
- String mytext = java.net.URLEncoder.encode("中国", "utf-8");
- String mytext2 = java.net.URLDecoder.decode(mytext, "utf-8");
-
- 这两条语句在同一个页面中的话,得到的结果是:
- mytext: %E4%B8%AD%E5%9B%BD
- mytex2: 中国
-
- String zhongguo=new String(request.getParameter("zhongguo").getBytes("iso8859_1"));
- zhongguo=java.net.URLDecoder.decode(zhongguo,"utf-8");
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。