MySql Connector (python) and SQLAlchemy Unicode problem -
i using mysql connector (https://launchpad.net/myconnpy) sqlalchemy and, though table utf8, string columns returned normal strings not unicode. documentation doesn't list specific parameters utf8/unicode support mysql connector driver borrowed mysqldb driver. here connect string:
mysql+mysqlconnector://user:pass@myserver.com/mydbname?charset=utf8&use_unicode=0
i'd prefer keep using all-python mysql driver. suggestions?
to work unicode python objects should set optional parameter convert_unicode true when specifying character column type:
users = table('users', metadata, column('id', integer, primary_key=true) column('name', string(100, convert_unicode=true))
you use unicode type. check documentation details: string , unicode.
Comments
Post a Comment