问题
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.
回答1:
Are you using MySQL? You may need to change the collation and/or character sets for the tables in your database.
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;
来源:https://stackoverflow.com/questions/5418098/symfony-framework-load-cyrillic-data-into-database-from-fixtures