Re: [SQLObject] Unicode problem with MySQL-python < 1.2.2
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2008-10-17 22:37:47
|
On Fri, Oct 17, 2008 at 03:17:28PM -0700, Toshio Kuratomi wrote: > + if MySQLdb.version_info[:3] >= (1, 2, 1) and MySQLdb.version_info[:3] < (1, 2, 2): > + self.need_unicode = True > + else: > + self.need_unicode = False Unicode is required for MySQLdb 1.2.1 and 1.2.2beta, but not for 1.2.2final and up? Did I read it right? > + if self.need_unicode and not isinstance(query, unicode): > + try: > + query = unicode(query, self.dbEncoding) > + except UnicodeError: > + pass Another question: do I understand it right that MySQLdb *allows* unicode query strings but doesn't *require* them? Becasue my (humble and uninformed) opinion is to use that "loophole" and do not use unicode with MySQLdb (yet). Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |