16 messages in com.googlegroups.pylons-discussRe: SQLAlchemy + MySQL + UTF-8 suppor...| From | Sent On | Attachments |
|---|---|---|
| andyprog | 10 May 2007 19:46 | |
| bjpirt | 11 May 2007 02:42 | |
| bjpirt | 11 May 2007 02:42 | |
| Max Ischenko | 11 May 2007 04:44 | |
| andyprog | 11 May 2007 07:28 | |
| David Smith | 28 May 2007 23:44 | |
| Shannon -jj Behrens | 28 May 2007 23:53 | |
| David Smith | 29 May 2007 01:13 | |
| Max Ischenko | 29 May 2007 02:02 | |
| David Smith | 29 May 2007 02:27 | |
| Shannon -jj Behrens | 29 May 2007 07:23 | |
| Max Ischenko | 29 May 2007 09:56 | |
| David Smith | 29 May 2007 10:02 | |
| Mike Orr | 29 May 2007 17:09 | |
| Mike Orr | 31 May 2007 14:19 | |
| ysamlan | 12 Jun 2007 15:49 |
| Subject: | Re: SQLAlchemy + MySQL + UTF-8 support - how?![]() |
|---|---|
| From: | David Smith (davi...@public.gmane.org) |
| Date: | 05/29/2007 01:13:28 AM |
| List: | com.googlegroups.pylons-discuss |
jj, I actually agree strongly with you regarding the potential dangers. My counter argument is that if you specify the encoding of the database in the config file to a different encoding than is in the mysql config file, don't you risk double-encoding anyway? Now that the bug is fixed in MySQLdb, and no other database needs such options, I'd prefer to promote the Unicode field as the proper way forward. SQLAlchemy should, via the MySQLdb module, determine at runtime the encoding of the database and translate from that encoding to unicode objects as necessary (as should any other ORM).
Cheers, David
Shannon -jj Behrens wrote:
I'm not necessarily disagreeing with you, but I do think it's really bad practice to have your database confused about the encoding of the data that it's storing. At one point, I had things messed up and the data in the database was double encoded. Sure, it worked as long as I was using SQLAlchemy, but if I ever decided to use something else, I would have been in really bad shape. Fortunately, they fixed that bug in MySQLdb.
Happy Hacking! -jj




