public static String codePointToString ( String point ) { String ret ; if ( Strings . isNullOrEmpty ( point ) ) { return point ; } int unicodeScalar = Integer . parseInt ( point , 16 ) ; if ( Character . isSupplementaryCodePoint ( unicodeScalar ) ) { ret = String . valueOf ( Character . toChars ( unicodeScalar ) ) ; } else { ret = String . valueOf ( ( char ) unicodeScalar ) ; } return ret ; }
Transforms an Unicode code point given as a hex string into a proper encoded string . Supplementary code points are encoded in UTF - 16 as required by Java .