#!/home/ben/software/install/bin/perl use warnings; use strict; use Template; use utf8; # Give the object an argument ENCODING my $tt = Template->new ({ ENCODING => 'utf8', INCLUDE_PATH => ['.'], }); my %vars = ( pinyin => 'zì hé nán jīng luàn guān nèi zǔ jī xiōng dì lí sǎn gè zài yī chù…', ); $tt->process ('unicode-file.txt', \%vars, 'tt-no-binmode.txt') or die $tt->error ();