public static char decodeEntity ( String name ) { if ( name . startsWith ( "#x" ) ) { try { return ( char ) Integer . parseInt ( name . substring ( 2 ) , 16 ) ; } catch ( NumberFormatException nfe ) { return ' ' ; } } if ( name . startsWith ( "#" ) ) { try { return ( char ) Integer . parseInt ( name . substring ( 1 ) ) ; } catch ( NumberFormatException nfe ) { return ' ' ; } } Character c = ( Character ) map . get ( name ) ; if ( c == null ) return ' ' ; else return c . charValue ( ) ; }
Translates an entity to a unicode character .