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

(-)a/reports/guided_reports.pl (-5 / +3 lines)
Lines 19-25 Link Here
19
19
20
20
21
use CGI qw/-utf8/;
21
use CGI qw/-utf8/;
22
use Text::CSV;
22
use Text::CSV::Encoded;
23
use URI::Escape;
23
use URI::Escape;
24
use File::Temp;
24
use File::Temp;
25
use C4::Reports::Guided;
25
use C4::Reports::Guided;
Lines 772-778 elsif ($phase eq 'Run this report'){ Link Here
772
}
772
}
773
773
774
elsif ($phase eq 'Export'){
774
elsif ($phase eq 'Export'){
775
    binmode STDOUT, ':encoding(UTF-8)';
776
775
777
	# export results to tab separated text or CSV
776
	# export results to tab separated text or CSV
778
	my $sql    = $input->param('sql');  # FIXME: use sql from saved report ID#, not new user-supplied SQL!
777
	my $sql    = $input->param('sql');  # FIXME: use sql from saved report ID#, not new user-supplied SQL!
Lines 790-797 elsif ($phase eq 'Export'){ Link Here
790
        } else {
789
        } else {
791
            my $delimiter = C4::Context->preference('delimiter') || ',';
790
            my $delimiter = C4::Context->preference('delimiter') || ',';
792
            my $csv_content = q||;
791
            my $csv_content = q||;
793
            my $csv = Text::CSV->new({binary => 1, sep_char => $delimiter});
792
            my $csv = Text::CSV::Encoded->new({ encoding_out => 'utf8', sep_char => $delimiter});
794
            $csv or die "Text::CSV->new({binary => 1}) FAILED: " . Text::CSV->error_diag();
793
            $csv or die "Text::CSV::Encoded->new({binary => 1}) FAILED: " . Text::CSV::Encoded->error_diag();
795
            if ($csv->combine(header_cell_values($sth))) {
794
            if ($csv->combine(header_cell_values($sth))) {
796
                $csv_content .= $csv->string(). "\n";
795
                $csv_content .= $csv->string(). "\n";
797
            } else {
796
            } else {
798
- 

Return to bug 11679