private String escapeHTML(String source) {
        String strResult = "";
        String sourceText = "";
        int k;

        Integer srcLen = source.length();

        // Cycle through each input character.
        if (srcLen > 0) {

            for (int i = 0; i < srcLen; i++) {
                sourceText = source.substring(i, i + 1);
                // search in htmlEscape[][] if sourceText is there
                k = 0;
                while (k < htmlEscape.length) {
                    if (htmlEscape[k][1].equals(sourceText)) {
                        break;
                    } else {
                        k++;
                    }
                }
                if (k < htmlEscape.length) {
                    strResult += htmlEscape[k][0];
                } else {
                    strResult += source.substring(i, i + 1);
                }
            }
        }

        return strResult;
    }