How to print unicode character U-1F4A9 'pile o

2019-03-18 07:43发布

I am trying to print a unicode character in Ruby, specifically the pile of poo. It has a unicode value of U-1F4A9. But when I try to print "\u1F4A9" to the output or a file, I see nothing.

Do I need to print to a specific type of file to see the pile of poo? If so, what type of file? Is there any way to print this to the common output? (I'm using Rubymine)

1条回答
戒情不戒烟
2楼-- · 2019-03-18 08:17

Unicode code points with more than four hex digits must be enclosed in curly braces:

puts "\u{1f4a9}"
# =>                                                                     
查看更多
登录 后发表回答