I'm building a map of emoji unified unicode characters to their common names. I have strings representing each emoji, in UTF16 format. For example, the string "00A9" represents the copyright symbol. I need to convert that into a utf8 rune, so I can compare it to input I receive from the user, but I haven't found the right incantation of the hex/utf16/utf8 packages to do so.
Parse the hex string as an integer. Use a string conversion to convert the integer to UTF-8.
n, err := strconv.ParseInt("00A9", 16, 32)
if err != nil {
log.Fatal(err)
}
s := string(n)
There are unicode packages in Go