Here you can find the source of htmlEncoding(String str)
public static String htmlEncoding(String str)
//package com.java2s; //License from project: Open Source License public class Main { public static String htmlEncoding(String str) { StringBuffer bfu = new StringBuffer(); if (str != null) { String s = "&#"; char[] cs = str.toCharArray(); for (char c : cs) { int it = c; bfu.append(s).append(it).append(";"); }/*ww w . j a v a 2 s .c o m*/ } return bfu.toString(); } }