Thursday, October 08, 2009

MySQL unicode query in python

It’s very easy to run MySQL Unicode query in python. Just use the Unicode string by putting u on the front of string and use \u for Unicode char.

q = u"select * from tableName where column01 = \"\u09e7\u09e8\""
cursor.execute(q)

No comments: