@@ -, +, @@ binmode(STDOUT); binmode( STDOUT, ":utf8" ); --- Koha/Borrower/Discharge.pm | 2 +- members/discharge.pl | 3 ++- opac/opac-discharge.pl | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) --- a/Koha/Borrower/Discharge.pm +++ a/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' ); --- a/members/discharge.pl +++ a/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', --- a/opac/opac-discharge.pl +++ a/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', --