Bug #3047: weird regexp behavior with $KCODE='u'
http://redmine.ruby-lang.org/issues/show/3047

Author: Marcus Rückert
Status: Open, Priority: Normal
ruby -v: ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] 

$ cat regexp-bug.rb

  #!/usr/bin/ruby
  def testme
    STDERR.puts(("§" =~ /^\w+$/)? "Wrong ($KCODE: #{$KCODE})":"Correct ($KCODE: #{$KCODE})")
  end
  testme
  $KCODE='u';
  testme

running this on my 1.8.7 system i get:

  ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
  Correct ($KCODE: NONE)
  Wrong ($KCODE: UTF8)

expected would be that it doesnt match in both cases.


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