Re: [Templates] XML::Simple, encoding, latin1
[prev]
[thread]
[next]
[Date index for 2004/07/21]
Oleg Burlaca wrote:
>
> [% USE xdoc = XML.Simple(xml_document) %]
> title: [% xdoc.title.latin1 %]
> ^^^^^^
What about a filter:
package Blah::Template::Plugin::ForceEncoding;
use base qw( Template::Plugin::Filter );
sub filter {
my ($self, $text);
my $to = $self->{_ARGS}[0] || 'latin1';
my $u = utf8($text);
return $u->$to;
}
[% USE latin1 = ForceEncoding 'latin1' %]
[% FILTER $latin1 %]
title: [% xdoc.title %]
.. etc ...
[% END %]
Gavin.
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
 |
Re: [Templates] XML::Simple, encoding, latin1
Gavin Estey 15:37 on 21 Jul 2004
|