Looking into this issue a bit more revealed that in the StringValidator class, line 505 on col.py, the from_python function tries to encode all unicode type strings to ascii. Is this correct behavior? If so how can I get around it ?

Thanks

 Glenn

On Jan 4, 2008 4:08 PM, Glenn MacGregor <glennmac@gmail.com> wrote:
Hi All,

I am plugging along with Python and SQLObject, very cool stuff. I have a string which contains utf8 (unicode) characters. When I try to add an instance of the table class with that string I get an error:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128)

The string I am inserting is Ch\xe9rie, where \xe9 is e with an umlaut. I am not sure if this is the database sending this message or SQLObject.

I am using MySQL 5 and I have created the tables with a default charset of utf8.

Thanks

 Glenn