Hi all.

I'm encountering MakoRenderingException and UnicodeDecodeError
exceptions throughout my application when trying to render utf8 data
which was originally user input.

There don't seem to be Pyramid configuration options for Mako's
output_encoding='utf-8', encoding_errors='replace'.

Python/Mako magic doesn't seem to be doing it either, ## -*- coding:
utf-8 -*-

I've tried using a mako filter, which helped: mako.default_filters =
decode.utf8 (in .ini file)
But I still have problems anywhere I'm using filters or functions in
my templates: ${var_with_utf8_chars | custom_filter}
This seems to fix it but I don't want to have to do this throughout
the entire application: ${var_with_utf8_chars.decode('utf8') }
custom_filter}

I was thinking if the above is the only way, the best place to do it
would be at the model level when the utf8 data is loaded out of the
database.  But I was hoping for a better, more magical solution.

Anyone have any ideas?

Thanks,
Mike

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to