#encode(CharSequence) the specified text, preserving line breaks, tabs and spaces for rendering by converting them to markup.
This performs the same encoding as
#encode(CharSequence,boolean), but also performs the following conversions:
- Line breaks, being Carriage Return (U+000D) or Line Feed (U+000A) characters, and Form Feed characters (U+000C)
are converted to "
<br />
". CR/LF pairs are treated as a single line break.
- Multiple consecutive spaces are converted so that every second space is converted to "
"
while ensuring the last is always a normal space.
- Tab characters (U+0009) are converted as if they were four consecutive spaces.
The conversion of multiple consecutive spaces to alternating space/non-breaking-space allows the correct number of
spaces to be rendered, but also allows the line to wrap in the middle of it.
Note that zero-width spaces (U+200B) are converted to the numeric character reference
"​
" through the normal encoding process, but IE6 does not render them properly
either encoded or unencoded.
There is no method provided to reverse this encoding.