views:

110

answers:

1

Hi,

i've a rails app that runs using utf-8. It uses a mysql database, all tables with mysql's default charset and collation (i.e. latin1). Therefore the latin1 tables contain utf-8 data. Sure, that's not nice, but i'm not really interested in it. Everything works fine, because the connection encoding is latin1 as well and therefore mysql does not convert between charsets.

Only one problem: i need a utf-8 fulltext index for one table:

mysql> show create table autocompletephrases;

... AUTO_INCREMENT=310095 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

But: I don't want to convert between charsets in my rails app. Therefore I would like to know if i could just set config/database.yml

production:
     adapter: mysql
>>>> encoding: binary
     ...

which just calls SET NAMES 'binary' when connecting to mySQL. It looks like it works for my case, because i guess it forces mysql to -not- convert between charsets (mySQL docs). Does anyone knows about problems about doing this? Any side-effects?

Or do you have any other suggestions? But i'd like to avoid converting my whole database to utf-8.

Many Thanks! Benjamin

A: 

I feel like there's compelling reason to just convert rather then introduce something that's going to temporarily solve your problem till you will end up needing to convert in the future.

i'd save yourself the future pain by just converting now.

morgan