durumdara wrote:
>
> Hi!
>
> I port some Cheetah site to Mako.
> C is uses ISO-8859-2 templates, and my datas - they are also
> ISO-8859-2 encoded...
>
> Now I use in my all view:
>
> $(c.tounicode(param) |h}
> $(c.tounicode(MailRecord['Main']) |h}
> etc.
>
> I wanna search for a solution where I can handle all of my inputs in
> mako internally, and convert it to needed format...
>
> For example:
> def MyCallBack(Param):
> return tounicode(Param)
>
> RegisterCallBack(MyCallBack)
>
> Do you know about same method to avoid this problem?
>
> We have ليé, and other chars that are not handled by utf8, and if I
> forget to write this input conversion, possible the site will
> unavailable for users with a simple hungarian user input... :-(
look into adding a default filter:
http://www.makotemplates.org/docs/filtering.html#filtering_expression_defaultfilters