Bug #3237
closedirb exits unexpectedly with Encoding::CompatibilityError
Description
=begin
The irb exits unexpectedly with incompatible character encodings error when I try to call Non-ASCII method for Non-ASCII string.
C:\work>ruby -v
ruby 1.9.2dev (2010-04-30 trunk 27556) [i386-mswin32_90]
C:\work>irb
irb(main):001:0> "한글".가나다 ## <= Korean characters
NoMethodError: c:/usr/lib/ruby/1.9.1/irb.rb:168:in to_str': incompatible charac ter encodings: CP949 and ASCII-8BIT (Encoding::CompatibilityError) from c:/usr/lib/ruby/1.9.1/irb.rb:168:in
to_s'
from c:/usr/lib/ruby/1.9.1/irb.rb:168:in write' from c:/usr/lib/ruby/1.9.1/irb.rb:168:in
print'
from c:/usr/lib/ruby/1.9.1/irb.rb:168:in block (2 levels) in eval_input ' from c:/usr/lib/ruby/1.9.1/irb.rb:273:in
signal_status'
from c:/usr/lib/ruby/1.9.1/irb.rb:156:in block in eval_input' from c:/usr/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in
block (2 levels) in e
ach_top_level_statement'
from c:/usr/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in loop' from c:/usr/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in
block in each_top_lev
el_statement'
from c:/usr/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in catch' from c:/usr/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in
each_top_level_statem
ent'
from c:/usr/lib/ruby/1.9.1/irb.rb:155:in eval_input' from c:/usr/lib/ruby/1.9.1/irb.rb:70:in
block in start'
from c:/usr/lib/ruby/1.9.1/irb.rb:69:in catch' from c:/usr/lib/ruby/1.9.1/irb.rb:69:in
start'
from c:/usr/bin/irb.bat:20:in `'
C:\work>
=end