Converts the specified string so as certain special characters are encoded into named or numeric entities.

Parameters:

s

The string to be encoded.
markupChars
Specifies to encode all characters that may be used in XML markup (default true).

The following table shows all such characters and the entities into which they are encoded:

Character Entity
< &lt;
& &amp; 
> &gt;
quoteChars
Specifies encoding of all double quote characters (default false):
Character Entity
" &quot;
controlChars
Specifies to encode all control characters (those with the codes < 32) into numeric entities (default false).

For example, '\n' will be encoded as &#10;

nonAsciiLetters
Specifies to encode all non-ASCII letters into numeric entities (default false).

The non-ASCII letters are the characters whose codes >= 128 and for which the Java method

java.lang.Character.isLetter()
returns true.

Other non-letter characters with the codes >= 128 are always encoded by this method.

For example, € is encoded as &#8364;

Returns:

The result string with the encoded characters.