public void characters(char[] ch,int start,int length) throws SAXException {
  try {
    stopTerminator();
    if (w == null)     return;
    int end=start + length;
    for (int i=start; i < end; i++) {
      char c=ch[i];
switch (c) {
case '&':
        w.write("&amp;");
      break;
case '<':
    w.write("&lt;");
  break;
case '>':
w.write("&gt;");
break;
case '\n':
case '\r':
case '\t':
w.write(c);
break;
default :
if (canEncode(c)) {
w.write(c);
}
 else {
w.write("&#");
w.write(Integer.toString(c));
w.write(";");
}
break;
}
}
}
 catch (IOException e) {
throw new SAXException(e);
}
}

public void characters ( char [ ] ch , int start , int length ) throws SAXException { try { stopTerminator ( ) ; if ( w == null ) return ; int end = start + length ; for ( int i = start ; i < end ; i ++ ) { char c = ch [ i ] ; switch ( c ) { case '&' : w . write ( "&amp;" ) ; break ; case '<' : w . write ( "&lt;" ) ; break ; case '>' : w . write ( "&gt;" ) ; break ; case '\n' : case '\r' : case '\t' : w . write ( c ) ; break ; default : if ( canEncode ( c ) ) { w . write ( c ) ; } else { w . write ( "&#" ) ; w . write ( Integer . toString ( c ) ) ; w . write ( ";" ) ; } break ; } } } catch ( IOException e ) { throw new SAXException ( e ) ; } }
inserts a string of characters into the document .
