ignores :utf8 => true argument
mattes opened this issue · 4 comments
mattes commented
m = RE2::Regexp.new(regex, :utf8 => true).match(content)
puts m[1].encoding
=> ASCII-8BIT
m = RE2::Regexp.new(regex).match(content)
puts m[1].encoding
=> ASCII-8BIT
mattes commented
treat results with encode("utf-8", "iso-8859-1")
should help for now.
mudge commented
The issue here is that the :utf8
argument is passed through to the underlying re2 library but the gem itself doesn't use any of Ruby 1.9's string encoding. We'll have to make sure that any encoding support is conditional so that the gem remains compatible with Ruby 1.8.
mudge commented
@tenderlove's "String Encoding in Ruby 1.9 Extensions" should help here.
mudge commented
Fixed as of v0.6.0.