Bugzilla – Attachment 45501 Details for
Bug 15290
SQL reports encoding problem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15290: (follow-up)SQL reports headers encoding problem
Bug-15290-follow-upSQL-reports-headers-encoding-pr.patch (text/plain), 2.21 KB, created by
Jonathan Druart
on 2015-12-08 15:47:38 UTC
(
hide
)
Description:
Bug 15290: (follow-up)SQL reports headers encoding problem
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-12-08 15:47:38 UTC
Size:
2.21 KB
patch
obsolete
>From 1d2131f6f54aaefdbbf1850cbb0e6c3cd57784d1 Mon Sep 17 00:00:00 2001 >From: Hector Castro <hector.hecaxmmx@gmail.com> >Date: Thu, 3 Dec 2015 13:20:40 -0600 >Subject: [PATCH] Bug 15290: (follow-up)SQL reports headers encoding problem >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Fix SQL row data and headers enconding problem > >To test: >-Apply patches >-Follow previous test plan >-Notice the headers and row data is displayed in UTF-8 > without double encoding >-Save in Comma separated text, Tab seprated text, and Open Document. >-Verify in the three options the file exported is Ok > >Signed-off-by: Frédéric Demians <f.demians@tamil.fr> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > reports/guided_reports.pl | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index cbdecda..8684ba5 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -816,6 +816,7 @@ elsif ($phase eq 'Export'){ > if ($format eq 'tab') { > $type = 'application/octet-stream'; > $content .= join("\t", header_cell_values($sth)) . "\n"; >+ $content = Encode::decode('UTF-8', $content); > while (my $row = $sth->fetchrow_arrayref()) { > $content .= join("\t", @$row) . "\n"; > } >@@ -823,10 +824,10 @@ elsif ($phase eq 'Export'){ > my $delimiter = C4::Context->preference('delimiter') || ','; > if ( $format eq 'csv' ) { > $type = 'application/csv'; >- my $csv = Text::CSV::Encoded->new({ encoding_out => 'utf8', sep_char => $delimiter}); >+ my $csv = Text::CSV::Encoded->new({ encoding_out => 'UTF-8', sep_char => $delimiter}); > $csv or die "Text::CSV::Encoded->new({binary => 1}) FAILED: " . Text::CSV::Encoded->error_diag(); > if ($csv->combine(header_cell_values($sth))) { >- $content .= $csv->string(). "\n"; >+ $content .= Encode::decode('UTF-8', $csv->string()) . "\n"; > } else { > push @$q_errors, { combine => 'HEADER ROW: ' . $csv->error_diag() } ; > } >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15290
:
45353
|
45384
|
45385
|
45456
|
45457
| 45501 |
45502