List of utility methods to do String Escape
String | escapeXML(String message) Formats the message to be XML compatible, with the XML escaping. StringBuilder msgBuffer = new StringBuilder(message.length() * 2); escapeXML(message, msgBuffer); return msgBuffer.toString(); |
String | escapeXml(String str) Escapes XML entities in a if (str == null) { return str; StringBuffer buf = new StringBuffer(str.length() * 2); int i; for (i = 0; i < str.length(); ++i) { char ch = str.charAt(i); String entityName = getEntityName(ch); ... |
String | escapeXML(String str) escape some special xml chars. if (str == null) return null; str = str.replace("&", "&"); str = str.replace("'", "'"); str = str.replace("\"", """); str = str.replace("<", "<"); str = str.replace(">", ">"); StringBuilder sb = new StringBuilder(); ... |
String | percentEncode(String s) percent Encode if (s == null) { return ""; try { return URLEncoder.encode(s, ENCODING) .replace("+", "%20").replace("*", "%2A").replace("%7E", "~"); } catch (UnsupportedEncodingException uee) { throw new RuntimeException(uee.getMessage(), uee); ... |
String | percentEncode(String s) Percent encode a string String result = ""; try { if (s != null) { result = URLEncoder.encode(s, ENCODING).replace("%7E", "~").replace("*", "%2A").replace("+", "%20"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); return result; |
String | percentEncode(String value) percent Encode return value == null ? EMPTY : URLEncoder.encode(value, encode);
|
String | percentEncode(String value, String encoding) percent Encode return value != null ? URLEncoder.encode(value, encoding).replace("+", "%20").replace("*", "%2A").replace("%7E", "~") : null; |
String | percentEncodeRfc3986(final String string) Percent-encode values according the RFC 3986. try { return URLEncoder.encode(string, "UTF-8").replace("+", "%20").replace("*", "%2A").replace("%7E", "~"); } catch (final UnsupportedEncodingException e) { return string; |