Bugzilla – Attachment 38415 Details for
Bug 11603
Gather print notices: add csv and ods export
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 11603: Fix encoding issues (bug 11944 is now pushed)
PASSED-QA-Bug-11603-Fix-encoding-issues-bug-11944-.patch (text/plain), 2.81 KB, created by
Katrin Fischer
on 2015-04-23 12:29:20 UTC
(
hide
)
Description:
[PASSED QA] Bug 11603: Fix encoding issues (bug 11944 is now pushed)
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-04-23 12:29:20 UTC
Size:
2.81 KB
patch
obsolete
>From 39dfc4728f2ef9f06b6adef5bc3c32bb5764bebc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 14 Apr 2015 11:07:00 +0200 >Subject: [PATCH] [PASSED QA] Bug 11603: Fix encoding issues (bug 11944 is now > pushed) > >Signed-off-by: Frederic Demians <f.demians@tamil.fr> > No more encoding issue with html file, no problem with csv|ods > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >--- > misc/cronjobs/gather_print_notices.pl | 17 ++++++++--------- > 1 file changed, 8 insertions(+), 9 deletions(-) > >diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl >index 890c8ce..b852680 100755 >--- a/misc/cronjobs/gather_print_notices.pl >+++ b/misc/cronjobs/gather_print_notices.pl >@@ -9,8 +9,7 @@ BEGIN { > eval { require "$FindBin::Bin/../kohalib.pl" }; > } > >-use >- CGI; # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy >+use CGI qw( utf8 ); # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy > use C4::Context; > use C4::Dates; > use C4::Debug; >@@ -180,7 +179,7 @@ sub generate_html { > messages => $messages, > ); > >- open my $OUTPUT, '>', $filepath >+ open my $OUTPUT, '>encoding(utf-8)', $filepath > or die "Could not open $filepath: $!"; > print $OUTPUT $template->output; > close $OUTPUT; >@@ -191,7 +190,7 @@ sub generate_csv { > my $messages = $params->{messages}; > my $filepath = $params->{filepath}; > >- open my $OUTPUT, '>', $filepath >+ open my $OUTPUT, '>encoding(utf-8)', $filepath > or die "Could not open $filepath: $!"; > my ( @csv_lines, $headers ); > foreach my $message ( @$messages ) { >@@ -201,13 +200,13 @@ sub generate_csv { > # We don't have headers, get them > unless ( $headers ) { > $headers = $lines[0]; >- say $OUTPUT Encode::encode( 'UTF8', $headers ); >+ say $OUTPUT $headers; > } > > shift @lines; > for my $line ( @lines ) { > next if $line =~ /^\s$/; >- say $OUTPUT Encode::encode( 'UTF8', $line ); >+ say $OUTPUT $line; > } > } > } >@@ -250,11 +249,11 @@ sub generate_ods { > shift @lines; # remove headers > my $i = 1; > for my $line ( @lines ) { >- my $row_data = split $delimiter, $line; >+ my @row_data = split $delimiter, $line; > my $row = $doc->getRow( $table, $i ); > # Note scalar(@$row_data) should be equal to $nb_cols >- for ( my $j = 0 ; $j < scalar(@$row_data) ; $j++ ) { >- my $value = Encode::encode( 'UTF8', $row_data->[$j] ); >+ for ( my $j = 0 ; $j < scalar(@row_data) ; $j++ ) { >+ my $value = Encode::encode( 'UTF8', $row_data[$j] ); > $doc->cellValue( $row, $j, $value ); > } > $i++; >-- >1.7.10.4
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 11603
:
25021
|
25022
|
25023
|
25024
|
25640
|
25642
|
30980
|
30981
|
30982
|
30983
|
37799
|
37812
|
37813
|
37814
|
37815
|
37816
|
37817
|
37829
|
37830
|
37831
|
37832
|
37833
|
37834
|
37837
|
38381
|
38385
|
38386
|
38387
|
38388
|
38389
|
38390
|
38391
|
38392
|
38403
|
38411
|
38412
|
38413
|
38414
|
38415
|
38416
|
38417
|
38418
|
38419
|
39033
|
39034
|
39035
|
39036
|
39037
|
39038
|
39039
|
39040
|
39041