usung no ascii characters

7 views
Skip to first unread message

Antonio Fregoso

unread,
Mar 24, 2014, 1:10:58 PM3/24/14
to toscawidge...@googlegroups.com


Hi all:

I'm using accented characters [á,é,í,ó,ú,ü] an ñ. In my code y have

phone=twf.TextField(label='Teléfono:')

and when I call from web y have this error.

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)

I'm using Mako templates Turbogears


Thanks for your help :-)

Paul Johnston

unread,
Mar 24, 2014, 1:50:27 PM3/24/14
to toscawidge...@googlegroups.com
Hi,

You should pass a unicode object into the widget, e.g. phone=twf.TextField(label=u'Teléfono:'). You may also need to set your source encoding http://legacy.python.org/dev/peps/pep-0263/

Paul




--
You received this message because you are subscribed to the Google Groups "ToscaWidgets-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to toscawidgets-dis...@googlegroups.com.
To post to this group, send email to toscawidge...@googlegroups.com.
Visit this group at http://groups.google.com/group/toscawidgets-discuss.
For more options, visit https://groups.google.com/d/optout.

Antonio Fregoso

unread,
Mar 24, 2014, 1:56:34 PM3/24/14
to toscawidge...@googlegroups.com

Thank you. It works perfectly Paul.
Reply all
Reply to author
Forward
0 new messages