Bug #3237: irb exits unexpectedly with Encoding::CompatibilityError
http://redmine.ruby-lang.org/issues/show/3237

Author: Heesob Park
Status: Open, Priority: Low
Category: lib, Target version: 1.9.x
ruby -v: ruby 1.9.2dev (2010-04-30 trunk 27556) [i386-mswin32_90]

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 `<main>'

C:\work>


----------------------------------------
http://redmine.ruby-lang.org