mudge/re2

ignores :utf8 => true argument

mattes opened this issue · 4 comments

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

treat results with encode("utf-8", "iso-8859-1") should help for now.

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.

Fixed as of v0.6.0.