From 753c8ef6c26e962eb2d40192bccd3249d9f07081 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 18 Dec 2014 15:39:46 +0100 Subject: [PATCH] Bug 8007: Compatibility with bug 11944 This patch should be applied to work with bug 11944. If you don't have 11944 yet, just don't apply this patch. Note that the line binmode(STDOUT); in pl files is mandatory. It comes from bug 11944 that adds the line binmode( STDOUT, ":utf8" ); in C4::Templates::gettemplate. Signed-off-by: Lucie Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- Koha/Borrower/Discharge.pm | 2 +- members/discharge.pl | 3 ++- opac/opac-discharge.pl | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Koha/Borrower/Discharge.pm b/Koha/Borrower/Discharge.pm index 1665bc74e6..ea84f7889d 100644 --- a/Koha/Borrower/Discharge.pm +++ b/Koha/Borrower/Discharge.pm @@ -111,7 +111,7 @@ sub generate_as_pdf { my $html_path = tmpnam() . '.html'; my $pdf_path = tmpnam() . '.pdf'; my $html_content = $tmpl->output; - open my $html_fh, '>', $html_path; + open my $html_fh, '>:encoding(utf8)', $html_path; say $html_fh $html_content; close $html_fh; my $pdf = PDF::FromHTML->new( encoding => 'utf-8' ); diff --git a/members/discharge.pl b/members/discharge.pl index 54a9f46ec0..e2f703d141 100755 --- a/members/discharge.pl +++ b/members/discharge.pl @@ -29,7 +29,7 @@ Allows librarian to edit and/or manage borrowers' discharges use Modern::Perl; -use CGI; +use CGI qw( -utf8 ); use C4::Auth; use C4::Output; use C4::Members; @@ -78,6 +78,7 @@ if ( $input->param('borrowernumber') ) { my $pdf_path = Koha::Borrower::Discharge::generate_as_pdf( { borrowernumber => $borrowernumber, } ); + binmode(STDOUT); print $input->header( -type => 'application/pdf', -charset => 'utf-8', diff --git a/opac/opac-discharge.pl b/opac/opac-discharge.pl index 8338d05c7d..e6eca73512 100755 --- a/opac/opac-discharge.pl +++ b/opac/opac-discharge.pl @@ -20,7 +20,7 @@ use Modern::Perl; use C4::Auth qw(:DEFAULT get_session); -use CGI; +use CGI qw( -utf8 ); use C4::Context; use C4::Output; use C4::Log; @@ -59,6 +59,7 @@ elsif ( $op eq 'get' ) { borrowernumber => $loggedinuser }); + binmode(STDOUT); print $input->header( -type => 'application/pdf', -charset => 'utf-8', -- 2.39.5