1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* re.c (rb_reg_quote): use rb_enc_mbcput to generate ASCII

incompatible characters properly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-09-15 16:01:08 +00:00
parent b73891b5f1
commit 2e0a116dd5
3 changed files with 25 additions and 14 deletions

View file

@ -355,4 +355,10 @@ EOT
assert_equal("", sl.chop)
assert_equal("", sb.chop)
end
def test_regexp_escape
s = "\0*".force_encoding("UTF-16BE")
r = Regexp.new(Regexp.escape(s))
assert(r =~ s)
end
end