Issue #4217 has been updated by Heesob Park.


I think r30412 is incomplete.

After applying r30412, while the second case is fixed, the first case is still exist.

irb(main):001:0> Regexp.new("\xFF")
RegexpError: c:/usr/lib/ruby/1.9.1/irb.rb:168:in `write': "\xFF" on CP949 (Encoding::InvalidByteSequenceError)
        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 each_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_level_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_statement'
        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:19:in `<main>'

C:\work>irb
irb(main):001:0> /\xFF/
SyntaxError: (irb):1: invalid multibyte escape: /\xFF/
        from c:/usr/bin/irb.bat:19:in `<main>'
irb(main):002:0>

----------------------------------------
http://redmine.ruby-lang.org/issues/show/4217

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