Johnny Blonde a écrit :
> Here i am once more having some character-set problems.
>
> my dsn:
> sqlobject.dburi="notrans_mysql://user:[EMAIL PROTECTED]/database"
>
>
> my class:
> class aTest(SQLObject):
>         class sqlmeta:
>                 table="atest_test"
>
>         name=UnicodeCol(length=100)
>
>
> in the shell:
>   
>>>> aTest(name="abc")
>>>>         
> <aTest 1L name=u'abc'>
>
> #this one was alright BUT:
>
>   
>>>> meinTest(name="äöü") # causes:
>>>>         
> Traceback (most recent call last):
> (...)
>   File "/usr/lib/python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/
> sqlobject/main.py", line 1111, in set
>     value = to_python(dbValue, self._SO_validatorState)
>   File "/usr/lib/python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/
> sqlobject/col.py", line 549, in to_python
>     return unicode(value, self.db_encoding)
>   File "/usr/lib/python2.4/encodings/utf_8.py", line 16, in decode
>     return codecs.utf_8_decode(input, errors, True)
> UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-2:
> invalid data
>
>
>
> If i change dsn and append "?charset=utf8" and >>>
> meinTest(name="äöü") last line of error traceback changes to:
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 0:
> unexpected end of data
>
>
> The Database, the table and the corresponding field "name" in the
> table have the collation "utf8_unicode_ci", charset "utf8"
>
>
> What can i do to solve the problem this time?
>
>   
what about meinTest(name=u"äöü") ??

many errors come from strings constants with non ascii characters not 
specified as unicode strings (u"...")

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to