From: James Gray Date: 2008-09-15T06:51:41+09:00 Subject: [ruby-core:18584] [Bug #563] Regexp::escape is not Encoding Aware Bug #563: Regexp::escape is not Encoding Aware http://redmine.ruby-lang.org/issues/show/563 Author: James Gray Status: Open, Priority: Normal Category: M17N Escaping an encoded String can damage the encoding: >> s = "+" => "+" >> s.encode!("UTF-16BE") => "\x00+" >> re = Regexp.escape(s) => "\\+" >> re.encoding => # ---------------------------------------- http://redmine.ruby-lang.org