File "/var/lib/python-support/python2.4/kid/pull.py", line 194, in to_unicode
return unicode(value, encoding)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xbf in position
261: unexpected code byte
On 10/17/07, Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
>
> Lukasz Szybalski schrieb:
> > I run into a problem when I was displaying my data from mysql database.
> > Is there a bug in KID that prohibits it from reading some UTF8 values?
> >
> > Is there a fix for it? How can I get rid of this error?
>
> You're probably inserting some encoded string into your template instead
> of a unicode string.
Should I convert the data to unicode before I sent it to the template?
Use unicode instead.
Is the data converted automatically from unicode mysql database?
In case this does not help
> you, please show us your controller code and the template used.
>
the data is coming from mysql.
controller:
data=model.XXX.select((model.XXX.c.YEAR==year) &
(model.XXX.c.MAKE==make)&(model.XXX.c.MODEL==vmodel))
return dict(data=data)
template:
<div py:for="row in data">
<hr/>
<p py:for="column in row.c.keys()">
<strong><span py:content="column">column</span></strong>
<span py:content="getattr(row,column)">data</span>
</p><hr/>
</div>
Any ideas on how to get rid of that error?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---