public static String htmlEncode ( final String html ) { validate ( html , NULL_STRING_PREDICATE , NULL_STRING_MSG_SUPPLIER ) ; return html . chars ( ) . mapToObj ( c -> "\\u" + String . format ( "%04x" , c ) . toUpperCase ( ) ) . map ( HtmlEntities . encodedEntities :: get ) . collect ( joining ( ) ) ; }
Convert all applicable characters to HTML entities .