16 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: Ascii codec instead ...| From | Sent On | Attachments |
|---|---|---|
| Arun Kumar PG | 15 Aug 2007 08:33 | |
| jason kirtland | 15 Aug 2007 08:44 | |
| Arun Kumar PG | 15 Aug 2007 09:01 | |
| Michael Bayer | 15 Aug 2007 10:17 | |
| Arun Kumar PG | 15 Aug 2007 10:56 | |
| Arun Kumar PG | 15 Aug 2007 10:57 | |
| Andrew Stromnov | 15 Aug 2007 11:17 | |
| jason kirtland | 15 Aug 2007 11:23 | |
| Arun Kumar PG | 15 Aug 2007 11:32 | |
| jason kirtland | 15 Aug 2007 11:36 | |
| Arun Kumar PG | 16 Aug 2007 03:04 | |
| Arun Kumar PG | 19 Aug 2007 02:22 | |
| jason kirtland | 19 Aug 2007 09:28 | |
| Arun Kumar PG | 20 Aug 2007 00:35 | |
| jason kirtland | 20 Aug 2007 11:18 | |
| Arun Kumar PG | 21 Aug 2007 00:32 |
| Subject: | [sqlalchemy] Re: Ascii codec instead of unicode ?![]() |
|---|---|
| From: | Arun Kumar PG (arun...@gmail.com) |
| Date: | 08/20/2007 12:35:37 AM |
| List: | com.googlegroups.sqlalchemy |
So in short if I specify use_unicode=True at the SA engine level then I can skip specifying use_unicode and specify only charset=utf8 at mysqldb level ?
On 8/19/07, jason kirtland <je...@discorporate.us> wrote:
Arun Kumar PG wrote:
Ok, you need to get that charset to the driver. Try removing SET NAMES from your init_command, and instead pass charset=utf8 and use_unicode=0 in your database connection URL.
why do we want to say use_unicode=0 instead or use_unicode=True here?
You can go either way with that. The MySQLdb driver's default behavior when given a 'charset' is to also turn on its "return all strings in Unicode" mode. If you want all of your strings as Unicode that's just dandy, but if you expecting them to come back as regular strings encoded in the charset you requested you'd be in for a surprise...
In my own code I enable use_unicode and I don't specify any Unicode options or column types at the SQLAlchemy level.
-j
-- Cheers,
- A
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqla...@googlegroups.com
To unsubscribe from this group, send email to
sqla...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---




