what's your kid template test.kid's file encoding? it should be also utf-8,
it seems to be processed using uft-8.

On Fri, Mar 20, 2009 at 1:56 PM, Cazy <[email protected]> wrote:

>
> Hello,
> I run into a problem when I was displaying my data from oracle
> database with sqlalchemy .
>
>  File "c:\python25\lib\site-packages\kid-0.9.6-py2.5.egg\kid
> \parser.py", line 206, in to_unicode
>    return unicode(value, encoding)
> UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1:
> invalid data
> Error in code generated from template file 'C:\\orcltest\\orcltest\
> \templates\\test.kid'
>
> model.py:
> from turbogears.database import bind_meta_data
> bind_meta_data()
> worker_t = Table('work_person', metadata, autoload=True)
>
> controllers.py:
>        work_list = session.query(model.Worker).all()
>        return dict(workers=work_list)
>
> test.kid:
> <tr py:for="worker in workers">
> <td>${worker.name}</
> td>
> <td align="center">${worker.dept_no}</td>
> <td>${worker.age}</td>
> </tr>
>
> worker.name is in chinese words, and they cannot show in my web brower
> But when I type
> for worker in workers
>   print worker.name
> in tg-admin shell , it show in the right way
>
> BTW:
> >>> import sys
> >>> sys.getdefaultencoding()
> 'utf-8'
>
> Thanks  A lot
> Cazy
>
> >
>


-- 
Yours sincerely

Jack Su

--~--~---------~--~----~------------~-------~--~----~
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