question: static String encodeEntities ( String source ) { StringBuffer buffer = new StringBuffer ( ) ; String encoded ; for ( int index = 0 ; index < source . length ( ) ; index ++ ) { char ch = source . charAt ( index ) ; if ( ( encoded = encodeEntity ( ch ) ) != null ) { buffer . append ( encoded ) ; } else { buffer . append ( ch ) ; } } return buffer . toString ( ) ; }
target:  Utility method for encoding HTML entities within query parameters.