I don't know SQLObject, but MySQLdb's connect(..) function takes
parameters that decide on how it handles unicode, namely "use_unicode"
and "charset" [1].

Both MySQL itself and MySQLdb are very flexible when it comes to
unicode and data encoding - you can make it do almost anything you
want.

Maybe someone that knows more about SQLObject can tell us how to
change the parameters to connect(...)

With SQLAlchemy, there is a "Unicode" type, that translates
automatically between UTF-8 strings in the database and python unicode
objects. I have MySQLdb execute "set character set utf8" on
connecting, which makes it return utf8 encodes strings to SQLAlchemy.
MySQL then handles the conversion between UTF-8 and whatever character
set is defined on my db/tables/columns automatically.

Arnar

[1] 
http://sourceforge.net/docman/display_doc.php?docid=32071&group_id=22307#functions-and-attributes

On 7/29/06, pierreva <[EMAIL PROTECTED]> wrote:
>
> pc wrote:
> > Hi Pierre,
> >
> > I have wasted a lot of time this week about this issue. I guess you
> > have MySQLdb 1.2.1.
> > It looks like MySQLdb 1.2.1 (in contrast to MySQLdb 1.2.0) expects
> > unicode strings in its
> > queries. But, SQLObject passes the strings to MySQLdb as normal strings
> > with its default encoding
> > (utf8).
> >
> > I've mailed yesterday the sqlobject mailing list about this and still
> > expecting a reply.
> Did you receive any reply ?
> >
> > At the time being, the possible solutions are:
> > 1. Downgrade to MySQLdb 1.2.0
> > 2. Use a different database engine (I had success in unicode with
> > sqlite)
> > 3. Check out SQLAlchemy (I didn't try it yet)
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to