views:

600

answers:

2

I'm trying to get Unicode working properly in rails using MySQL. Now, Rails displays the text correctly, but it shows up as ??? in MySQL. Additionally, I am not able to filter the text.

My MySQL database has been configured with the utf8 character set. My client character is also UTF8. Likewise, rails is set to use UTF8.

If I enter the Unicode string directly from the MySQL client, it is stored properly in the table, but Rails does not correctly display it.

How do I get the data in, properly formatted in the database?

A: 

Perhaps whatever you're using to view your database isn't configured properly for unicode. For instance, if you're using a terminal in some linux distro: the terminal shell may not be configured correctly to display unicode characters.

mepcotterell
Its not just a display issue. Filtering, even from the rails application, doesn't work.
+1  A: 

Have you tried adding this to your database.yml under your environment?

encoding: utf8

Sikachu