The tips below are what I've learned while implementing a gem, github_reactions, to summarize reactions on GitHub issues and pull requests.
Get codepoints from emoji
"๐".unpack("U*")
=> [128077]
"๐".codepoints
=> [128077]
# Convert to hexadecimal
"๐".each_codepoint.map {|n| n.to_s(16) }
=> ["1f44d"]
Get emoji from codepoints
[128077].pack("U*")
=> "๐"
0x1f44d.chr('UTF-8')
=> "๐"
"\u{1f44d}"
=> "๐"
Top comments (0)