[Templates] XML::Simple, encoding, latin1
[prev]
[thread]
[next]
[Date index for 2004/07/21]
I have a xml document: encoding="ISO-8859-1"
in my script I have:
$Template::Stash::SCALAR_OPS->{ 'latin1' } = sub {
my $u = utf8( shift );
return $u->latin1;
};
in my templates:
[% USE xdoc = XML.Simple(xml_document) %]
title: [% xdoc.title.latin1 %]
^^^^^^
The problem(inconvenience and awkwardness) is that i have to ".latin1"
everytime I'm working with xml. Is there a simple way to "latin1" the whole data structure
returned by XML::Simple ? (if .latin1 is not used, the browser displays the html in utf)
I've googled on this but didn't find any solution.
I understand that it is not TT related, but it would be graceful if you'll just point me
to the right place or share your experience if you had this problem before.
Thanks.
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
[Templates] XML::Simple, encoding, latin1
Oleg Burlaca 09:26 on 21 Jul 2004
|