luislavena/rb-readline — Issue #58: rb-readline with ruby 1.9.3-p0 on Windows cannot display non-ascii characters.
Author: phasis68
Created: 2011-11-01 06:19:41+00:00
State: open

Hi,

I installed rubyinstaller 1.9.3-p0.
I found irb with rb-readline cannot display non-ascii caracters during input like this:
C:\work>irb
irb(main):001:0> a = "������"
=> "가나다"

In ruby-1.9.2-p290, it works as expected.
C:\work>irb
irb(main):001:0> a = "가나다"
=> "가나다"

This issue is due to some changes in rb_w32_write_console of win32.c

To display correct non-ascii characters, line #3807 of rbreadline.rb
@_rl_out_stream.write(string[start,count])
should be
@_rl_out_stream.write(string[start,count].force_encoding(@encoding_name))

Regards,
Park Heesob