Upgrading from mysql to mysql2 breaks UTF-8

For some reason I didn’t start using mysql2 until recently on my
Rails3/1.9.2 project and I just noticed that this change caused some
of my data to display incorrectly.

I guess the mysql gem doesn’t really store data in UTF-8 so I wrote a
migration to fix the broken items.

My question is, do I need to change anything else in the mysql
configuration since it was created via the mysql gem instead of the
mysql2 gem?

These commands show the same information for DBs created via mysql and
mysql2 so I suspect I am safe. :slight_smile:

SHOW VARIABLES LIKE ‘collation%’;
SHOW VARIABLES LIKE ‘character%’;

On Wed, Apr 13, 2011 at 9:57 AM, Tony P.
[email protected]wrote:

These commands show the same information for DBs created via mysql and
mysql2 so I suspect I am safe. :slight_smile:

SHOW VARIABLES LIKE ‘collation%’;
SHOW VARIABLES LIKE ‘character%’;

I would set the encoding in my database.yml file just to be safe.

encoding: utf8

B.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs