my $r = shift;
my $index = new FileHandle (">$file") or die "Cannot write to '$file'";
+ open(my $index, ">:encoding(utf-8)", "$file") or die "Cannot write to '$file'";
my $tdata = OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{template}->{data} );
if ($r->{html_format}) {
# create the raw output html file
- my $raw = new FileHandle (">$file.raw.html") or die "Cannot write to '$file.raw.html'";
+ open(my $raw, ">:encoding(utf-8)", "$file.raw.html") or die "Cannot write to '$file.raw.html'";
print $raw "<html><head><meta charset='utf-8'><title>$$r{report}{name}</title>";
print $raw <<' CSS';
}
print $raw '</body></html>';
- $raw->close;
+ close($raw);
}
# Time for a pie chart
# and that's it!
print $index '</body></html>';
- $index->close;
+ close($index);
}
sub draw_pie {