[Catalyst] Catalyst Unicode woes ...

Jonas Alves jonas.alves at gmail.com
Thu Aug 9 12:27:26 GMT 2007


On 09/08/07, Pedro Melo <melo at simplicidade.org> wrote:
> Hi,
>
> On Aug 9, 2007, at 10:40 AM, Tatsuhiko Miyagawa wrote:
>
> > Similarly even if your templates are encoded in utf-8,
> > Template-Toolkit doesn't know which encoding they are in, until you
> > set BOM to your templates or use Template::Provider::Encoding to
> > explicitly specify the encoding to decode the template.
>
> hmms.. Is there a third way, just telling TT that all my templates
> are in UTF8? Setting the BOM is not easy with some editors.

Looking at Template::Provider::Encoding description:

"Template::Provider::Encoding is a Template Provider subclass to
decode template using its declaration. You have to declare encoding of
the template in the head (1st line) of template using (fake) encoding
TT plugin. Otherwise the template is handled as utf-8."

So if you want utf8 you just need to use T::P::E and don't need to
explicitly specify the encoding.

-- 
Jonas



More information about the Catalyst mailing list