开发者

Mysql2 gem not working with UTF8

开发者 https://www.devze.com 2023-02-12 23:45 出处:网络
I\'ve switched my Rails app from the Mysql gem to Mysql2, but now UTF8 fields aren\'t working; specifically, the character á is coming out as á.The character appears correctly in the MySQL console

I've switched my Rails app from the Mysql gem to Mysql2, but now UTF8 fields aren't working; specifically, the character á is coming out as á. The character appears correctly in the MySQL console, when using PHP, and when using the Mysql gem. I have set encoding: utf8 in my database.yml file.

Potentially helpful

When I inspect it character-for-character in the console, I see that á is 开发者_如何学运维"\303\241" (using the Mysql gem) but á is "\303\203\302\241" (using the Mysql2 gem).

0

精彩评论

暂无评论...
验证码 换一张
取 消