java encodeuri 中文
String string = attachmentURL; Pattern p = Pattern.compile("[\u4e00-\u9fa5]+"); Matcher m = p.matcher(string); StringBuffer b = new StringBuffer(); while (m.find()) { m.appendReplacement(b, URLEncoder.encode(m.group(0), "utf-8")); } m.appendTail(b); System.out.println(b.toString()); String resultURL = b.toString();