Symfony框架 - 将Cyrillic数据从灯具加载到数据库 [英] Symfony framework - load Cyrillic data into database from fixtures

查看:127
本文介绍了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;

这篇关于Symfony框架 - 将Cyrillic数据从灯具加载到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆