[Templates] Plugins and Unicode confusion
Bernhard Graf
tt@augensalat.de
Thu, 16 Feb 2006 22:11:18 +0100
On Thursday 16 February 2006 21:40, Tatsuhiko Miyagawa wrote:
> On 2/16/06, Bernhard Graf <tt@augensalat.de> wrote:
> > I got this reply by PM - think it is OK to post it on the list:
>
> D'oh. sorry.
>
> > Why does the expansion into UTF-8 (and maybe other encodings) fail,
> > when all components on their do it right?
>
> Actually, if your template file is Unicode flagged, (which is
> possible by adding BOM to your template head, or using
> Template::Provider::Encoding module on CPAN) your latin-1 string is
> automatically upgraded to UTF-8.
Still no joy (and a warning):
perl \
-MTemplate::Stash::ForceUTF8 \
-MTemplate::Provider::Encoding \
-MTemplate -e \
'Template->new({
LOAD_TEMPLATES =3D> [ Template::Provider::Encoding->new],
STASH =3D> Template::Stash::ForceUTF8->new
})->process("tt.tt")'
Wide character in print=20
at /usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi/Template.pm=20
line 168.
N=E4chster Monat: M?z
> That's really annoying for non latin-1 users though, and that's why I
> inveneted Template::Provider::Encoding module and stuff like that.
Good idea. But doesn't work. :-((
=2D-=20
Bernhard Graf