Bug #3237

irb exits unexpectedly with Encoding::CompatibilityError

Added by Heesob Park about 5 years ago. Updated about 4 years ago.

[ruby-core:29948]
Status:Closed
Priority:Low
Assignee:-
ruby -v:ruby 1.9.2dev (2010-04-30 trunk 27556) [i386-mswin32_90] Backport:

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

History

#1 Updated by Nobuyoshi Nakada about 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r27615.
Heesob, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF