Symfony框架 - 将Cyrillic数据从灯具加载到数据库
问题描述:
如何使用Cyrillic数据将数据从fixture文件加载到数据库?
How can I load data into database from fixture files with Cyrillic data?
我试过,但数据库中的数据转换为?符号。
I've tried, but data in database is converted to ??? symbols. My fixture file is saved in UTF-8 encoding.
答
您使用的是MySQL吗?您可能需要更改数据库中表格的排序规则和/或字符集。
Are you using MySQL? You may need to change the collation and/or character sets for the tables in your database.
A 整个部分存在于MySQL手册中,如果您的国际化项目范围很广,我建议您使用此SQL每个表将帮助您:
A whole section exists in the MySQL Manual on this topic which I recommend if your project scope for internationalisation is wide, but essentially applying this SQL to each table will help you:
ALTER TABLE tablename CHARACTER SET utf8 COLLATE utf8_general_ci;