On Sun, Sep 10, 2006 at 02:41:02PM +0200, Markus Gritsch wrote:
> The following code worked in SQLObject-0.7.1b1 but raises an exception
> when with SQLObject-0.7.1rc1:
> 
> # -*- coding: latin-1 -*-
> 
> from sqlobject import *
> 
> sqlhub.processConnection = connectionForURI('mysql://[EMAIL PROTECTED]/test')
> 
> class Test(SQLObject):
>     name = UnicodeCol()
> 
> Test.createTable(ifNotExists=True)
> Test(name=u'sch?n')

[skip]

>     myquery = unicode(query, self.encoding)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
> 36: ordinal not in range(128)

   self.encoding here is "ascii". Change the encoding:

sqlhub.processConnection = connectionForURI('mysql://[EMAIL 
PROTECTED]/test?sqlobject_encoding=latin1')

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to