zsol / cupapp

A starcraft2 replay sharing site
www.cupapp.com
8 stars 0 forks source link

Database encoding is not utf8 #13

Closed eshton closed 13 years ago

eshton commented 13 years ago

http://test.cupapp.com/en/replay/view/10/2v2-High_Orbit-Yom-Zsol-Ones-krizis

Look at my comment, some special characters weren't save correctly.

zsol commented 13 years ago

The problem here was indeed the database configuration. The default charset was latin1, so if you didn't specify an explicit charset, every database, table, column would get created with latin1. I have changed that now and updated the DB default charset but I think it would be good to generate charset specifications in the SQLs as well.

zsol commented 13 years ago

It seems like symfony's schema.yaml doesn't support specifying the default character set. Propel's schema.xml does, though; so we could switch to that and specify this as a vendor specific setting, only for mysql. I think this is overkill. For now, we just have to make sure that the database that's created has the correct default charset (utf8). We can do this in the deploy script.

eshton commented 13 years ago

I think it is intentional. Symfony and its ORM shouldn't know about the database and its permissions or whatever, so it is the developer's (or the one's who deploys the application) responsibility to provide a database name and access parameters so it will work with encoding that matches the developer's intentions.