mySQLdb versus platform problem

John Nagle nagle at animats.com
Fri Mar 16 15:32:32 EDT 2007


Try:

     db=MySQLdb.connect(host='appx',db='sc_0',user='user',passwd='secret',
	use_unicode=True, charset = "utf8")

The distinction is that "use_unicode" tells Python to convert to Unicode,
but Python doesn't know the MySQL table type.  'charset="utf8"' tells
MySQL to do the conversion to UTF8, which can be reliably converted
to Unicode.

					John Nagle

Robin Becker wrote:
> I am seeing different outcomes from simple requests against a common 
> database when run from a freebsd machine and a win32 box.
> 
> 
> The test script is
...
> db=MySQLdb.connect(host='appx',db='sc_0',user='user',passwd='secret',use_unicode=True) 



More information about the Python-list mailing list