Displaying Unicode Characters in Ruby

By rainkinz on Mar 15, 2012, comments 73

If you know the Unicode character code and want to decode it you can do something like this:

  • Ruby 1.8
puts ["2665".hex].pack("U")
♥
=> nil
  • Ruby 1.9 In Ruby 1.9 the \u{} escape sequence can be used to decode unicode codepoints:
puts "\u{2665}"
♥
=> nil
6637
02790a417dfcc044d23ac30423a79f93.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest gzdXptQDFZ on Feb 01, 2020 at 2:01 PM

ZTnDQgEa

6638
02790a417dfcc044d23ac30423a79f93.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest GYbzMcTPQFUXiuR on Feb 01, 2020 at 2:01 PM

rSJThOcMkU

5785
Cfdae901e067df0956e6d35c6fa706b4.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest Mami on Sep 11, 2015 at 7:26 PM

2012/07/06 - 下午 2:54 5F Sweden Opera Mini 7.60 Windows Server 2003A new basic on the net search on a term FICO as well as criedt scores

5831
A6478799d355cc2abe0c2d2f4ad09dd4.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest Krishna on Oct 22, 2015 at 1:40 AM

Hi Carrie!We don't typically buy in other saetts, the travel time and cost plus shipping it back is just too high. Good luck selling and if you are ever in Arizona, please look us up!

5944
8fcbf39e6947a3281597a71c54332fe1.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest Deandre on Jan 06, 2016 at 7:50 PM

Time to face the music armed with this great inafomrtion.

5946
8fcbf39e6947a3281597a71c54332fe1.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest Deandre on Jan 06, 2016 at 7:52 PM

Time to face the music armed with this great inafomrtion.

5947
8fcbf39e6947a3281597a71c54332fe1.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest Deandre on Jan 06, 2016 at 7:53 PM

Time to face the music armed with this great inafomrtion.

6665
412c48093032cc835e406d7444538be0.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest LcHuaXYbDvmy on Mar 27, 2020 at 9:32 PM

RbfCumWtSTLsZ

6666
412c48093032cc835e406d7444538be0.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest ZvucUBaQiNAg on Mar 27, 2020 at 9:32 PM

vNLjuHFyxeEQ

6693
8aca8e79c7e7d52d62b416c1bb61b162.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest DayXmTwrQvZbi on Apr 24, 2020 at 5:19 AM

HYAlJhyPbBfxRN

6694
8aca8e79c7e7d52d62b416c1bb61b162.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest uOiXwVpf on Apr 24, 2020 at 5:19 AM

BIVbyseJxihzl

6468
B911aa8e00d378d4a8f82f2c3ec23537.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest ElvaPbp on Dec 26, 2017 at 11:38 PM

апрапрапр

6609
8989a6da2be2bcd88c679642585f1c43.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest diPkKrmvquUS on Dec 08, 2019 at 10:37 AM

hKZHpVrDlobJeAFn

6610
8989a6da2be2bcd88c679642585f1c43.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest eSdHlMhJq on Dec 08, 2019 at 10:37 AM

IRMzGtWbfFqaHVe

6713
6988018bbf7ab40b6a90804ab6958a9b.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest veGYDIOgzUVS on Apr 27, 2020 at 3:47 PM

LuYapcDQxGOK

6714
6988018bbf7ab40b6a90804ab6958a9b.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest WKNpBuUV on Apr 27, 2020 at 3:47 PM

mUraqQWbDecI

6737
Fa443a664437e7874c2c18506a7b9b48.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest AWxBsLKId on Jun 03, 2020 at 7:34 AM

PfkmFcDVUNX

6738
Fa443a664437e7874c2c18506a7b9b48.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest iPcgTHECXIQfBbAV on Jun 03, 2020 at 7:34 AM

DIwdKgcQyAXeHv

6764
14d5ef43cef94d7a64254838318bdebe.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest QEmLZGuWAJDY on Jun 06, 2020 at 10:21 AM

NdglUDAZYS

6765
14d5ef43cef94d7a64254838318bdebe.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest LTAqKOJu on Jun 06, 2020 at 10:21 AM

NHhCcyoY

6793
07643b56e2937b3e8bc11315b14772af.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest lFAXmyxMHBc on Jul 11, 2020 at 3:23 PM

wodYIVbtFci

6794
07643b56e2937b3e8bc11315b14772af.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest NsXkSurCFaIREwx on Jul 11, 2020 at 3:23 PM

xjIgGpeSNvwYQA

6821
E8e2f190c63ccb2ff0202416ef3dbaab.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest XqJMcxGVyezQYCbR on Jul 15, 2020 at 11:07 AM

UVwNbqkMAF

6822
E8e2f190c63ccb2ff0202416ef3dbaab.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest CfLUDXBukxYwM on Jul 15, 2020 at 11:07 AM

WkgwOcbsTlX

6863
83a3d3c45d0a84db9406fccd765182eb.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest MhTgEJsbWIc on Sep 14, 2020 at 10:01 AM

ckvbqhXNOT

6864
83a3d3c45d0a84db9406fccd765182eb.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest TpjLuaGESHtROK on Sep 14, 2020 at 10:01 AM

IjLAZNTRUdqBnDK

Comment: