Get emoticon unicode from char UTF-16
问题 I need to intercept an emoticon entry and change for my own emoticon. When I intercept an emoticon, for example, the FACE WITH MEDICAL MASK (\U+1F604), I get an UTF-16 char (0xD83D 0xDE04), Is it possible to convert this char value to the unicode value? I need to convert 0xD83D 0xDE04 to \u1f604. Thanks, 回答1: I get an UTF-16 char (0xD83D 0xDE04), Is it possible to convert this char value to the unicode value? For just a single code point in a string, you can convert it to an integer with: int