URLEncoder.encode(String)是对url中的中文参数进行编码解决乱码

public static String encode(String str) throws UnsupportedEncodingException {
String encodedURL = URLEncoder.encode(str, "UTF-8");
return encodedURL;
}

posted @ 2013-06-17 10:54  xxdc  阅读(792)  评论(0)    收藏  举报