Java只给汉字转URLEncoder

public static String encode(String str, String charset)
throws UnsupportedEncodingException {
Pattern p = Pattern.compile("[\u4e00-\u9fa5]+");
Matcher m = p.matcher(str);
StringBuffer b = new StringBuffer();
while (m.find()) {
m.appendReplacement(b, URLEncoder.encode(m.group(0), charset));
}
m.appendTail(b);
return b.toString();
}
上一篇:II7下配置SSAS通过HTTP 远程链接访问


下一篇:linux的PS进程和作业管理(进程调度,杀死进程和进程故障-僵尸进程-内存泄漏)