leoshaw / rubyripper

Automatically exported from code.google.com/p/rubyripper
0 stars 0 forks source link

Encoding bug with regexes #592

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
An error occures with some characters (I assume utf-8 charachetrs). The error 
is "incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)".

I have fixed the problem on my machine, don't feel like submitting a patch, but 
will describe the solution here:

rr_lib.rb:1660 and rr_lib.rb:1663: add 'n' to the end of the regex. So this 
changes the line from 
var.gsub!(/\342\200\230|\342\200\231/, "'") to 
var.gsub!(/\342\200\230|\342\200\231/n, "'")

Original issue reported on code.google.com by jgrego...@gmail.com on 26 Jun 2014 at 12:58

GoogleCodeExporter commented 8 years ago
Thanks jgrego, This fixed it for me.

Original comment by repeatu...@gmail.com on 10 Jan 2015 at 8:52