I am running into a strange issue with Template toolkit for Perl. I have been using it to generate some Readme files using templates that is encoded in utf8, earlier this year, the readme file that was generated was fine and was in Dos\Windows style of utf8 encoding, with CR\LF as line endings. Somehow something was changed in my code that now it generates readme files in the Macintosh style of utf8, with CR\CR\LF as line endings, which in turn made a lot unnecessary spacing in my generated Readme files.
The Code is below:
my $readme_tmpl = "README_tmpl.tt";
if($os_type eq "LINUX") {
$readme_tmpl = "README_tmpl_linux.tt";
}
my $data_dir = File::Spec->catdir($self->data_dir(), 'BuildSomething');
$data_dir =~ s/\\/\//g;
my $template = Template->new( INCLUDE_PATH => $data_dir );
my %readme_params;
$readme_params{build_app_name} = $pub_env->{BUILD_APP_NAME};
$readme_params{project_name} = $self->project();
$template->process($readme_tmpl, \%readme_params, $readme_file);
Where $readme_file is the path where the new file is going to be.
I am looking for ways to change it back to the Dos/Windows style of utf8 encoding, any ideas on how to do that?