Bug 24163: UTF-8 encode the output
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sat, 2 May 2020 13:57:16 +0000 (15:57 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 5 May 2020 10:08:44 +0000 (11:08 +0100)
Specify the UTF-8 charset in the header and Encode the output to avoid encoding issues

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

acqui/lateorders-export.pl

index 31e21a8..3975354 100755 (executable)
@@ -17,6 +17,7 @@
 
 use Modern::Perl;
 use CGI qw ( -utf8 );
+use Encode;
 
 use C4::Auth;
 use C4::Acquisition;
@@ -87,7 +88,8 @@ unless ( $csv_profile_id ) {
     print $input->header(
         -type       => 'text/csv',
         -attachment => 'lateorders.csv',
+        -charset    => 'UTF-8',
     );
-    print $csv;
+    print Encode::encode_utf8($csv);
     exit;
 }