Problems with using Unicode values in mako templates

30 views
Skip to first unread message

Bojan MIletic

unread,
Oct 14, 2012, 5:59:16 AM10/14/12
to pylons...@googlegroups.com
Hello,

I have a problem with rending mako templates to which I have passed some Unicode values . I get a following error:

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

Problem is solved with the following line of code:
${unicode(m, 'latin-1')}

in mako template every time i want to display said values. Solution in itself is not very elegant and it gets tiresome using it every time.

Is there a way to set latin-1 as a default codec instead of ascii for mako templates from inside the pyramid?


Reply all
Reply to author
Forward
0 new messages