Project

General

Profile

Bug #9096 ยป regexp-quote-encoding.rb

Repro - walles (Johan Walles), 11/08/2013 05:01 AM

 
#!/usr/bin/env ruby

require 'test/unit'

# Demonstration that Regexp.quote returns US-ASCII when fed UTF-8
class TestStuff < Test::Unit::TestCase
def test_stuff
assert_equal(Encoding::UTF_8, 'foo'.encoding,
'Foo should be UTF-8')
assert_equal(Encoding::UTF_8, Regexp.quote('foo').encoding,
'Quoted foo should be UTF-8')
end
end
    (1-1/1)