question: public static String encode ( String encode ) { StringBuilder str = new StringBuilder ( encode ) ; String key ; int i = 0 ; while ( i < str . length ( ) ) { key = findValue ( str . charAt ( i ) ) ; if ( key != null ) { str . replace ( i , i + 1 , key ) ; i += key . length ( ) ; } else { i ++ ; } } return str . toString ( ) ; }
target:  Converts special characters in ASCII into html entities (e.g. & -> &amp;)