private char[] mapNumericReference(int c){
  char[] data;
  if (c >= 0xffff) {
    try {
      data=Character.toChars(c);
    }
 catch (    IllegalArgumentException e) {
      data=new char[0];
    }
  }
 else {
    data=new char[1];
    data[0]=(c < 130 || c > 159) ? (char)c : cp1252Map[c - 130];
  }
  return data;
}

private char [ ] mapNumericReference ( int c ) { char [ ] data ; if ( c >= 0xffff ) { try { data = Character . toChars ( c ) ; } catch ( IllegalArgumentException e ) { data = new char [ 0 ] ; } } else { data = new char [ 1 ] ; data [ 0 ] = ( c < 130 || c > 159 ) ? ( char ) c : cp1252Map [ c - 130 ] ; } return data ; }
converts numeric character reference to char array . normally the code in a reference should be always converted to the unicode character with the same code , but due to wide usage of cp1252 charset most browsers map numeric references in the range 130 - 159 ( which are control chars in unicode set ) to displayable characters with other codes .
