urlEncode编码字符串到ACTION里是乱码

来源:百度知道 编辑:UC知道 时间:2024/05/29 04:31:50
我从JSP页面上传来的urlEncode编码字符串 到ACTION里是乱码 怎么解决啊

public static String forURL(String aURLFragment) {
String result = null;
try {
result = URLEncoder.encode(aURLFragment, "UTF-8");
} catch (UnsupportedEncodingException ex) {
throw new RuntimeException("UTF-8 not supported", ex);
}
return result;
}

用这个方法。URLEncoder.encode