Re: [htmltmpl] Escaping unicode
Brought to you by:
samtregar
From: Michael P. <mp...@pl...> - 2009-11-13 14:15:24
|
On 11/13/2009 08:26 AM, Tobias Nissen wrote: > For the data to be escaped before feeding it to H::T, I'd have to add > a lot of code, therefore I'd like to avoid this approach. Is there any > way I can tell H::T to escape Unicode data I feed to it with param()? You could create a function if you were using HTML::Template::Expr or you could subclass HTML::Template and change param to first filter the unicode chars for you. Then pass it off to the base class to do the rest. Would be an extremely simple subclass. > If not, then the next best thing would be to create a patched version of > H::T for my purposes with a method like param_escape() or sth like that, > right? No, please don't do that. Don't run with a patched version unless absolutely necessary. Instead go with a subclass. -- Michael Peters Plus Three, LP |