View | Details | Raw Unified | Return to bug 22323
Collapse All | Expand All

(-)a/misc/cronjobs/runreport.pl (-6 / +6 lines)
Lines 30-36 use Koha::DateUtils; Link Here
30
use Getopt::Long qw(:config auto_help auto_version);
30
use Getopt::Long qw(:config auto_help auto_version);
31
use Pod::Usage;
31
use Pod::Usage;
32
use MIME::Lite;
32
use MIME::Lite;
33
use Text::CSV_XS;
33
use Text::CSV::Encoded;
34
use CGI qw ( -utf8 );
34
use CGI qw ( -utf8 );
35
use Carp;
35
use Carp;
36
use Encode;
36
use Encode;
Lines 273-289 foreach my $report_id (@ARGV) { Link Here
273
        }
273
        }
274
        $message = $cgi->table(join "", @rows);
274
        $message = $cgi->table(join "", @rows);
275
    } elsif ($format eq 'csv') {
275
    } elsif ($format eq 'csv') {
276
        my $csv = Text::CSV_XS->new({
276
        my $csv = Text::CSV::Encoded->new({
277
            encoding_out => 'utf8',
277
            binary      => 1,
278
            binary      => 1,
278
            quote_char  => $quote,
279
            quote_char  => $quote,
279
            sep_char    => $separator,
280
            sep_char    => $separator,
280
            });
281
            });
281
282
282
        if ( $csv_header ) {
283
        if ( $csv_header ) {
283
            my $fields = $sth->{NAME};
284
            my @fields = map { decode( 'utf8', $_ ) } @{ $sth->{NAME} };
284
            $csv->combine( @$fields );
285
            $csv->combine( @fields );
285
            $message .= $csv->string() . "\n";
286
            $message .= $csv->string() . "\n";
286
            push @rows_to_store, [@$fields] if $store_results;
287
            push @rows_to_store, [@fields] if $store_results;
287
        }
288
        }
288
289
289
        while (my $line = $sth->fetchrow_arrayref) {
290
        while (my $line = $sth->fetchrow_arrayref) {
290
- 

Return to bug 22323