对于不支持中文的时候可以使用URLEncoder和URLDecoder编码解码
转换为ASCII的编码:
String s = URLEncoder.encode(str, "UTF-8");
再转换为UTF-8中文:
String str = URLDecoder.decode(s, "UTF-8");
发布时间: 2012-12-28 10:29:05 作者: rapoo
对于不支持中文的时候可以使用URLEncoder和URLDecoder编码解码
转换为ASCII的编码:
String s = URLEncoder.encode(str, "UTF-8");
再转换为UTF-8中文:
String str = URLDecoder.decode(s, "UTF-8");