X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=edithelp.pl;h=dca61b108a7ab3c4f220e5d0448cb2b5cb32c50b;hb=c6e488f4af72a2629fd86ee040a6973e2a6c73f4;hp=ce0c07546e6377ba1ff928c9b4645824790e6b69;hpb=a6c9bd0eb55c32d5632625144775271f20aa15f7;p=koha.git diff --git a/edithelp.pl b/edithelp.pl index ce0c07546e..dca61b108a 100755 --- a/edithelp.pl +++ b/edithelp.pl @@ -17,12 +17,11 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; +use Modern::Perl; use C4::Output; use C4::Templates; use C4::Auth; use CGI qw ( -utf8 ); -use warnings; use vars qw($debug); @@ -53,7 +52,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( borrowers => 1, permissions => 1, reserveforothers => 1, - borrow => 1, reserveforself => 1, editcatalogue => 1, updatecharges => 1, @@ -77,7 +75,7 @@ sub _get_filepath ($;$) { $type = 'create' if $type eq 'addnew'; if ( $type eq 'create' || $type eq 'save' ) { my $file = _get_filepath($referer); - open my $fh, ">", $file; + open my $fh, ">:encoding(utf-8)", $file; if ( $fh ) { # file is open write to it print $fh @@ -99,13 +97,13 @@ elsif ( $type eq 'modify' ) { } else { (-w $file) or $error = "WARNING: You will not be able to save, because your webserver cannot write to '$file'. Contact your admin about help file permissions."; - open (my $fh, '<', $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked - my $help = ''; + open (my $fh, '<:encoding(utf-8)', $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked + my $help = ''; while ( <$fh> ) { $help .= /\[% INCLUDE .* %\](.*)$/ ? $1 : $_; - } - close $fh; - $template->param( 'help' => $help ); + } + close $fh; + $template->param( 'help' => $help ); $type = 'save'; } }