Symfony framework - load Cyrillic data into database from fixtures

左心房为你撑大大i 提交于 2019-12-04 06:43:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!