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)