4

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?

4

2 回答 2

3

您是否尝试过在您的环境下将此添加到您的 database.yml 中?

encoding: utf8

于 2009-01-06T13:41:28.473 回答
0

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.

于 2008-12-09T04:54:20.313 回答