morgon has asked for the wisdom of the Perl Monks concerning the following question:
I work on a web-application that needs to generate XML in different encodings (utf-8 and iso8859-15), depending on the client.
I would like to generate the XML with TT, ideally with one shared template for both cases. (The problem is getting the interpolated variables encoded properly).
I have tried something like this:
But it does not come out right - it comes out as utf8.use strict; use Template; my $config = { ENCODING => "iso8859-15", }; my $template = Template->new($config); $template->process("test.tt", { var => "gödel" });
Can someone help me here?
The system is Ubuntu Server 10.04 with Perl 5.10.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Template Toolkit and different encodings
by ikegami (Patriarch) on Dec 23, 2010 at 00:57 UTC | |
|
Re: Template Toolkit and different encodings
by graff (Chancellor) on Dec 23, 2010 at 04:52 UTC | |
by morgon (Priest) on Dec 23, 2010 at 11:14 UTC | |
by graff (Chancellor) on Dec 23, 2010 at 14:21 UTC | |
by morgon (Priest) on Jan 07, 2011 at 15:50 UTC |