I am converting an old application that uses a mySQL database encoded with latin1. To do this I made a simple rake task and some classes to connect to the old legacy database (MySQL)
class LegacyComment < ActiveRecord::Base
establish_connection :legacy
end
The problem is no matter what I try to convert the old latin1 to utf8 I get odd characters:
"What he didn’t expect"
I've tried creating a duplicate table in the legacy database and then running
ALTER TABLE legacy_comments CONVERT TO CHARACTER SET utf8;
I've tried using Ruby's string.encode method from other answers I found here. Tried http://jalada.co.uk/2011/12/07/solving-latin1-and-utf8-errors-for-good-in-ruby.html to no avail.
I've tried varies settings in database.yml all with no luck. Not sure where to go next.