[Templates] UTF8 support and issues

Mark Proctor m.proctor@bigfoot.com
Mon, 18 Nov 2002 15:47:30 -0000


I am having problems with UTF8 code in my website. I have set UTF-8 for
both my page header Content-type and META content-Type tag. I retrieve
my form value from CGI and print that from perl, just before template
toolkit processes a page - it prints perfectly. I then print the same
variable within template toolkit and it prints garbled.

Is there something I need to do to tell template toolkit to use utf8?
Will upgrading to the latest version fix this? We have:
Perl5.6.1
template toolkit 2.04

------page content-type----------
print "Content-type: text/html; charset=UTF-8\n\n";
------meta content-Type----------
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
-------prints correctly before page is processed---------
print "itemText1", $self->{vars}->{validFields}->{itemText}, "<br>\n";
$self->{template}->process($self->{page}, $self->{vars}) || die
"Template process files: ", $self->{template}->error(), "\n";
-------prints garbled---------
itemText2:[%validFields.itemText%]<br>

Regards

Mark