@Deprecated
	public static void encodeHtml(CharSequence S, int start, int end, boolean make_br, boolean make_nbsp, Appendable out) throws IOException {
		if (S != null) {
			int toPrint = 0;
			for (int c = start; c < end; c++) {
				char ch = S.charAt(c);
				switch(ch) {
					// Standard XML escapes
					case '<':
						if(toPrint>0) {
							out.append(S, c-toPrint, c);
							toPrint=0;
						}
						out.append("&lt;");
						break;
					case '>':
						if(toPrint>0) {
							out.append(S, c-toPrint, c);
							toPrint=0;
						}
						out.append("&gt;");
						break;
					case '&':
						if(toPrint>0) {
							out.append(S, c-toPrint, c);
							toPrint=0;
						}
						out.append("&amp;");
						break;
					// Special (X)HTML options
					case ' ':
						if(make_nbsp) {
							if(toPrint>0) {
								out.append(S, c-toPrint, c);
								toPrint=0;
							}
							out.append("&#160;");
						} else {
							toPrint++;
						}
						break;
					case '\t':
						if(toPrint>0) {
							out.append(S, c-toPrint, c);
							toPrint=0;
						}
						out.append("&#x9;");
						break;
					case '\r':
						if(toPrint>0) {
							out.append(S, c-toPrint, c);
							toPrint=0;
						}
						// skip '\r'
						break;
					case '\n':
						if(make_br) {
							if(toPrint>0) {
								out.append(S, c-toPrint, c);
								toPrint=0;
							}
							out.append("<br />\n");
						} else {
							toPrint++;
						}
						break;
					default:
						if(ch<' ') {
							if(toPrint>0) {
								out.append(S, c-toPrint, c);
								toPrint=0;
							}
							// skip the character
						} else {
							toPrint++;
						}
				}
			}
			if(toPrint>0) out.append(S, end-toPrint, end);
		}
	}
@ Deprecated public static void encodeHtml ( CharSequence S , int start , int end , boolean make_br , boolean make_nbsp , Appendable out ) throws IOException { if ( S != null ) { int toPrint = 0 ; for ( int c = start ; c < end ; c ++ ) { char ch = S . charAt ( c ) ; switch ( ch ) { case '<' : if ( toPrint > 0 ) { out . append ( S , c - toPrint , c ) ; toPrint = 0 ; } out . append ( "&lt;" ) ; break ; case '>' : if ( toPrint > 0 ) { out . append ( S , c - toPrint , c ) ; toPrint = 0 ; } out . append ( "&gt;" ) ; break ; case '&' : if ( toPrint > 0 ) { out . append ( S , c - toPrint , c ) ; toPrint = 0 ; } out . append ( "&amp;" ) ; break ; case ' ' : if ( make_nbsp ) { if ( toPrint > 0 ) { out . append ( S , c - toPrint , c ) ; toPrint = 0 ; } out . append ( "&#160;" ) ; } else { toPrint ++ ; } break ; case '\t' : if ( toPrint > 0 ) { out . append ( S , c - toPrint , c ) ; toPrint = 0 ; } out . append ( "&#x9;" ) ; break ; case '\r' : if ( toPrint > 0 ) { out . append ( S , c - toPrint , c ) ; toPrint = 0 ; } break ; case '\n' : if ( make_br ) { if ( toPrint > 0 ) { out . append ( S , c - toPrint , c ) ; toPrint = 0 ; } out . append ( "<br />\n" ) ; } else { toPrint ++ ; } break ; default : if ( ch < ' ' ) { if ( toPrint > 0 ) { out . append ( S , c - toPrint , c ) ; toPrint = 0 ; } } else { toPrint ++ ; } } } if ( toPrint > 0 ) out . append ( S , end - toPrint , end ) ; } }
Escapes for use in a (X)HTML document and writes to the provided <code>Appendable</code>.
Optionally, it turns newlines into &lt;br /&gt; and spaces to &amp;#160;
Any characters less than 0x1f that are not \t, \r, or \n are completely filtered.

@param S the string to be escaped.  If S is <code>null</code>, nothing is written.
@param make_br  will write &lt;br /&gt; tags for every newline character
@param make_nbsp  will write &amp;#160; for a space when another space follows

@deprecated  the effects of makeBr and makeNbsp should be handled by CSS white-space property.
@see  TextInXhtmlEncoder