Hello,
I have a problem with sqlalchemy 5.8 and mysql 5.1. I have a table
with a text-column, which has the collation utf8_general_ci. When I
access the table sqlalchemy returns a Unicode, as it was expected. But
when I change the collation of the column to utf8_bin, sqlalchemy
returns an utf8-encoded string.
The mysql-engine is created with "?charset=utf8" and I'm using Python
2.6.5 on Ubuntu Lucid.
Here is a example query:
>>> selectTexts = sqlalchemy.select([
table.c.id,
table.c.text,
]).where(and_(
table.c.id==id));
>>> result = conn.execute(selectTexts).fetchall();
>>> print result[0][1]
With utf8_general_ci I get:
u'test \xe4 \xf6 \xfc'
and with utf8_bin I get:
'test \xc3\xa4 \xc3\xb6 \xc3\xbc'
I this behaviour intended? Is there a way to get Unicode from utf8_bin-
Tables/Columns?
Thanks in advance,
Marko