[Zope] MySQLdb and unicode

Andy Dustman farcepest at gmail.com
Fri May 6 09:52:02 EDT 2005


On 5/6/05, robert rottermann <robert at redcor.ch> wrote:
> Hi there,
> I have a problem using MySQLdb and unicode.
> with older version (0.92) I could set a parameter "unicode" to the
> connect() method to tell MySQLdb what charset to use.
> 
> This parameter is not accepted anymore.
> The only way to deal with non ascii character I found was setting
> pythons default charset to utf-8.

In 1.2, you can set use_unicode=True to tell it to return text-like
columns as unicode objects. This uses whatever the current character
set is on the connection. Prior to MySQL-4.1, there was no way to
change the character set being used via the client without at least
restarting the server. In 4.1 and newer, you can change this with a
client configuration file or with SQL; I recommend using
read_default_file.

If you're not using ZMySQLDA, then this really isn't a Zope issue, and
you should follow-up in the Help forum:
https://sourceforge.net/forum/forum.php?forum_id=70461
-- 
Computer interfaces should never be made of meat.
http://www.terrybisson.com/meat.html


More information about the Zope mailing list