Bug 22343: Fix runreport encoding issues

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2020-10-02 15:22:33 +02:00
parent 6fbf6f3df9
commit c4ebc20aa9

View file

@ -308,6 +308,7 @@ foreach my $report_id (@ARGV) {
$message .= $csv->string() . "\n"; $message .= $csv->string() . "\n";
push @rows_to_store, [@$line] if $store_results; push @rows_to_store, [@$line] if $store_results;
} }
$message = Encode::decode_utf8($message);
} }
if ( $store_results ) { if ( $store_results ) {
my $json = to_json( \@rows_to_store ); my $json = to_json( \@rows_to_store );
@ -332,7 +333,7 @@ foreach my $report_id (@ARGV) {
} }
$email->attach( $email->attach(
encode( 'utf8', $message ), Encode::encode_utf8($message),
content_type => "text/$format", content_type => "text/$format",
name => "report$report_id-$date.$format", name => "report$report_id-$date.$format",
disposition => 'attachment', disposition => 'attachment',