Re: Integer#chr

Skip Gibson <[email protected]> Sat, 24 Aug 2019 11:18:26 -0700
Newsgroups gmane.comp.lang.ruby.general
Message-ID <CAKyNmt7sqgLzJ-8xXE4u6pB8FuPN27UEYrfEJxDJRc2hyW45gA@mail.gmail.com>
I think you’ve just used the wrong unicode number, this should work

0x00C4.chr(Encoding::UTF_8)

Hope that helps,
Skip


On 24 August 2019 at 19:02:35, Detlef Wagner ([email protected]) wrote:

Hi,

i have a problem with Integer#chr, where the encoding is UTF-8. If I call

0xC384.chr(Encoding::UTF_8)

in irb, I expect the German umlaut Ä, but I get 쎄, where I even can't
say what language it is ;-)

Is it a bug, or do I something wrong?


Cheers, detlef


ruby version ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu]
irb version 0.9.6(09/06/30)

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>


Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>