List of utility methods to do HTML Encode
String | htmlEncode(String s) Helper method to html encode a string. StringBuffer sb = new StringBuffer(); int n = s.length(); for (int i = 0; i < n; i++) { char c = s.charAt(i); switch (c) { case '<': sb.append("<"); break; ... |
String | htmlEncode(String s) html Encode StringBuffer encodedString = new StringBuffer(""); char[] chars = s.toCharArray(); for (char c : chars) { if (c == '<') { encodedString.append("<"); } else if (c == '>') { encodedString.append(">"); } else if (c == '\'') { ... |
String | htmlEncode(String s) html Encode return htmlEncode(s, false);
|
String | HTMLEncode(String s) HTML Encode for (int j = 0; j < c.length; j++) { s = s.replace(c[j], expansion[j]); return s; |
String | htmlEncode(String s, boolean encodeSpecialChars) Escape html entity characters and high characters (eg "curvy" Word quotes). s = noNull(s, ""); StringBuilder str = new StringBuilder(); for (int j = 0; j < s.length(); j++) { char c = s.charAt(j); if (c < '\200') { switch (c) { case '"': str.append("""); ... |
String | htmlEncode(String s, boolean encodeWS) html Encode if (s == null) return null; char[] ca = s.toCharArray(); StringBuffer res = new StringBuffer(ca.length); int ls = 0; boolean blankMet = true; for (int i = 0; i < ca.length; i++) { switch (ca[i]) { ... |
String | HtmlEncode(String str) Html Encode str = str.replace(">", "<"); str = str.replace(">", "<"); return str; |
String | HTMLEncode(String str) Returns the string encoded for HTML use. if (null == str) return "null"; StringBuffer strbuf = new StringBuffer(str.length()); char tmp; for (int i = 0; i < str.length(); i++) { tmp = str.charAt(i); if ('<' == tmp) { strbuf.append("<"); ... |
String | htmlEncode(String str) html Encode if (str == null) { return null; for (int i = 0; i < invalidStr.length; i++) str = change(str, invalidStr[i], escapedStr[i]); return str; |
String | htmlEncode(String str) html Encode if (str != null) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c == '<') { sb.append("<"); } else { sb.append(c); ... |