From: Nobuyoshi Nakada Date: 2011-02-09T07:12:55+09:00 Subject: [ruby-core:35155] Re: [Ruby 1.9-Bug#4340] Encoding of result string for String#gsub is not consistent Hi, At Wed, 9 Feb 2011 04:41:14 +0900, mathew wrote in [ruby-core:35154]: >> Can I ask why regexps are not affected by >> # encoding: UTF-8 >> declarations? > > Nobody? > > I still can't think of a reason, so what am I missing? It does affect. $ ruby -e '#encoding:utf-8' -e 'p /\u3042/.encoding' # $ ruby -e '#encoding:cp932' -e 'p /\x81\x42/.encoding' # $ ruby -e '#encoding:euc-jp' -e 'p /\xa1\xa2/.encoding' # -- Nobu Nakada