On 4/18/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Wed, Apr 18, 2007 at 08:57:09PM +0200, Markus Gritsch wrote:
> > +                if self.need_unicode and not isinstance(query, unicode):
>
>    Can you add a test for this? Some test that produces  unicode query...

from sqlobject import *

# Works out of the box.
##sqlhub.threadConnection = connectionForURI('sqlite:/:memory:')

# Works only after applying the patch.
sqlhub.threadConnection =
connectionForURI('mysql://[EMAIL 
PROTECTED]/test?use_unicode=1&charset=utf8&sqlobject_encoding=utf-8')

class Person(SQLObject):
    name = UnicodeCol()

Person.dropTable(ifExists=True)
Person.createTable(ifNotExists=True)

p = Person(name=u'\u20ac') # \u20ac is the 'Euro symbol'.
print Person.select(LIKE(Person.q.name, u'\u20ac'))[0].name.encode('utf-8')

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to