#!/usr/bin/perl use strict; use warnings; use Template::Alloy; use Devel::Peek; binmode STDOUT, ':utf8'; my $t = Template::Alloy->new( filename => "utf8test", ENCODING => 'UTF-8', ); Dump $t->output; print $t->output; __END__ file utf8test: testarεδφΕΔΦ ============== output: SV = PV(0x825c260) at 0x82d629c REFCNT = 1 FLAGS = (TEMP,POK,pPOK,UTF8) PV = 0x82d5ea0 "testar\303\245\303\244\303\266\303\205\303\204\303\226\n"\0 [UTF8 "testar\x{e5}\x{e4}\x{f6}\x{c5}\x{c4}\x{d6}\n"] CUR = 19 LEN = 20 testarεδφΕΔΦ #### SV = PV(0x825c260) at 0x82d629c REFCNT = 1 FLAGS = (TEMP,POK,pPOK,UTF8) PV = 0x8332cc0 "testar\357\277\275\357\277\275\357\277\275\357\277\275\357\277\275\357\277\275\n"\0 [UTF8 "testar\x{fffd}\x{fffd}\x{fffd}\x{fffd}\x{fffd}\x{fffd}\n"] CUR = 25 LEN = 28 testar������