I get this error in Ruby 1.9, Rails 3.0, ActiveRecord 3.0:
incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)
This is because the line I'm trying to call gsub (which comes directly from the ActiveRecord object field) is ASCII-8BIT . I read several articles, messages and answers that say that this is caused by an error in the encoding of the mysql gsm code and the mysql2 suggestion.
But I am already using mysql2. I tried version 0.2.x and latest version 0.3.7 and will not solve the problem:
irb> str = Discussion.first.content => "Something wrong with encodings..." irb> str.encoding =>
I changed the database encoding and the table encoding in MySQL, I also tried setting the env LANG variable with no luck. Is there anywhere else I can look at or understand why I am getting this wrong encoding?
mltsy
source share