Symfony - Doctrine: Use a fully UTF8 database
Par Yoda-BZH le lundi, juillet 19 2010, 15:16 :: Coding :: Lien permanent
First, edit your config/databases.yml and add :
[yml]
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: mysql:socket=/var/run/mysqld/mysqld.sock;dbname=mydb
username: mydb
password: mypassword
encoding: utf8
attributes:
default_table_collate: utf8_unicode_ci
default_table_charset: utf8
Then open your config/doctrine/schema.yml and add at the top of your file :
|yml] --- detect_relations: true options: collation: utf8_unicode_ci charset: utf8 type: InnoDB
Of course, if you want to stick to myisam, replace InnoDB by MyIsam.
Befware, some plugins provides their own schema.yml. You may have to modify it, or to inherite it and specify that they're in utf8 (to come later)
Symfony 1.2, 1.3 and 1.4
Commentaires
Vous savez, il y'a toujours un truc dans sa chaussette qui nous gène et dont on arrive pas à se débarasser. Et bien voilà, moi c'était doctrine qui me faisait des misères avec l'utf8 et un build --all --and-load. C'est maintenant résolu grace aux explications ci-dessus. Merci Maïtre Yoda.