@Test public void escapeURLEncoding() { LocaleUtil.setContext(Locale.CHINA, "GBK"); assertEquals("%D6%D0%BB%AA%C8%CB%C3%F1%B9%B2%BA%CD%B9%FA", StringEscapeUtil.escapeURL("中华人民共和国")); LocaleUtil.setContext(Locale.US, "8859_1"); assertEquals("%3F%3F%3F%3F%3F%3F%3F", StringEscapeUtil.escapeURL("中华人民共和国")); LocaleUtil.resetContext(); }
public static String escapeURL(String str) { try { return escapeURLInternal(str, null, true); } catch (UnsupportedEncodingException e) { return str; } }
StringEscapeUtil { public static String escapeURL(String str) { try { return escapeURLInternal(str, null, true); } catch (UnsupportedEncodingException e) { return str; } } }
StringEscapeUtil { public static String escapeURL(String str) { try { return escapeURLInternal(str, null, true); } catch (UnsupportedEncodingException e) { return str; } }  }
StringEscapeUtil { public static String escapeURL(String str) { try { return escapeURLInternal(str, null, true); } catch (UnsupportedEncodingException e) { return str; } }  static String escapeJava(String str); static String escapeJava(String str, boolean strict); static void escapeJava(String str, Appendable out); static void escapeJava(String str, Appendable out, boolean strict); static String escapeJavaScript(String str); static String escapeJavaScript(String str, boolean strict); static void escapeJavaScript(String str, Appendable out); static void escapeJavaScript(String str, Appendable out, boolean strict); static String unescapeJava(String str); static void unescapeJava(String str, Appendable out); static String unescapeJavaScript(String str); static void unescapeJavaScript(String str, Appendable out); static String escapeHtml(String str); static void escapeHtml(String str, Appendable out); static String escapeXml(String str); static void escapeXml(String str, Appendable out); static String escapeEntities(Entities entities, String str); static void escapeEntities(Entities entities, String str, Appendable out); static String unescapeHtml(String str); static void unescapeHtml(String str, Appendable out); static String unescapeXml(String str); static void unescapeXml(String str, Appendable out); static String unescapeEntities(Entities entities, String str); static void unescapeEntities(Entities entities, String str, Appendable out); static String escapeSql(String str); static void escapeSql(String str, Appendable out); static String escapeURL(String str); static String escapeURL(String str, String encoding); static String escapeURL(String str, String encoding, boolean strict); static void escapeURL(String str, String encoding, Appendable out); static void escapeURL(String str, String encoding, Appendable out, boolean strict); static String unescapeURL(String str); static String unescapeURL(String str, String encoding); static void unescapeURL(String str, String encoding, Appendable out); }
StringEscapeUtil { public static String escapeURL(String str) { try { return escapeURLInternal(str, null, true); } catch (UnsupportedEncodingException e) { return str; } }  static String escapeJava(String str); static String escapeJava(String str, boolean strict); static void escapeJava(String str, Appendable out); static void escapeJava(String str, Appendable out, boolean strict); static String escapeJavaScript(String str); static String escapeJavaScript(String str, boolean strict); static void escapeJavaScript(String str, Appendable out); static void escapeJavaScript(String str, Appendable out, boolean strict); static String unescapeJava(String str); static void unescapeJava(String str, Appendable out); static String unescapeJavaScript(String str); static void unescapeJavaScript(String str, Appendable out); static String escapeHtml(String str); static void escapeHtml(String str, Appendable out); static String escapeXml(String str); static void escapeXml(String str, Appendable out); static String escapeEntities(Entities entities, String str); static void escapeEntities(Entities entities, String str, Appendable out); static String unescapeHtml(String str); static void unescapeHtml(String str, Appendable out); static String unescapeXml(String str); static void unescapeXml(String str, Appendable out); static String unescapeEntities(Entities entities, String str); static void unescapeEntities(Entities entities, String str, Appendable out); static String escapeSql(String str); static void escapeSql(String str, Appendable out); static String escapeURL(String str); static String escapeURL(String str, String encoding); static String escapeURL(String str, String encoding, boolean strict); static void escapeURL(String str, String encoding, Appendable out); static void escapeURL(String str, String encoding, Appendable out, boolean strict); static String unescapeURL(String str); static String unescapeURL(String str, String encoding); static void unescapeURL(String str, String encoding, Appendable out);  }