Search
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby
All Projects
Ruby
Overview
Activity
Roadmap
Issues
Repository
Like
Download (375 Bytes)
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)
Loading...