ruby - How to print unicode character U-1F4A9 'pile of poo' emoji -
i trying print unicode character in ruby, pile of poo. has unicode value of u-1f4a9. when try print "\u1f4a9" output or file, see nothing.
do need print specific type of file see pile of poo? if so, type of file? there way print common output? (i'm using rubymine)
unicode code points more 4 hex digits must enclosed in curly braces:
puts "\u{1f4a9}" # => 💩 this pretty poorly documented, don't feel bad not figuring out. nice thing curly brace syntax can embed multiple code points separated spaces:
puts "\u{1f4a9 1f60e}" # => 💩😎 of course, since ruby 2.0, utf-8 has been default encoding, can put emoji directly source:
puts "💩" # => 💩
Comments
Post a Comment