From: Daniel Harple Date: 2011-02-10T08:48:18+09:00 Subject: [ruby-core:35177] [Ruby 1.9-Bug#4386] encoding: directive does not affect regex expressions Issue #4386 has been updated by Daniel Harple. > US-ASCII only regexps are set to US-ASCII encoding, same as US-ASCII only strings. It's intentional. In this case Regexp is not consistent with String's behavior: $ cat test.rb # encoding: utf-8 r = /a/ s = "a" p [r, r.encoding] p [s, s.encoding] $ ruby -v test.rb ruby 1.9.2p136 (2010-12-25 revision 30365) [i386-darwin9.8.0] [/a/, #] ["a", #] ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4386 ---------------------------------------- http://redmine.ruby-lang.org