You said
> (using the same dbh call with UTF8 enabled)
This may be "internally decoded perl's utf8". So encode it to external UTF8 before you pass them to Tempalte.
And template#!/usr/bin/perl use strict; use warnings; use Encode qw(encode decode); use Template; my @chars_not_encoded=(); my @chars_encoded=(); #foreach my $code ( hex('3041') .. hex('3096') ){ foreach my $code ( hex('00C0') .. hex('00F0') ){ push @chars_not_encoded, chr($code); push @chars_encoded, encode('utf8', chr($code)) ; }; my $t =Template->new(); #corrupt output $t->process("test.tmpl", {lines=>\@chars_not_encoded}, "log_noenc" ) o +r die $t->error(); #OK $t->process("test.tmpl", {lines=>\@chars_encoded}, "log_enc" ) or die +$t->error();
<html> <head> <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +> </head> <body> [% FOREACH item IN lines %] item=#[% item %]#<br> [% END %] </body> </html>
I am also confusing about encoding of Template, And there seems a lot to read for theses troubles(for example Template::Provider::Encoding )... good luck
In reply to Re: Bug in Template?
by remiah
in thread Bug in Template?
by packetstormer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |