java 中文url的解决
使用的是struts框架,如果不用structs,则需查看容器比如tomcat的url编码类型
编码:
URLEncoder.encode(hobbies.toString(),"utf-8")
解码:
hobbiesParam_dec = new String(hobbiesParam.getBytes("ISO-8859-1"),"UTF-8");
编码:
URLEncoder.encode(hobbies.toString(),"utf-8")
解码:
hobbiesParam_dec = new String(hobbiesParam.getBytes("ISO-8859-1"),"UTF-8");
posted on 2009-09-27 19:21 speedmancs 阅读(383) 评论(0) 编辑 收藏 举报