From 71233175a9443a11e4918a876c5069b105786180 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 4 Nov 2014 10:58:35 +0100 Subject: [PATCH] locales.pl: Quelldateien mit Encoding UTF-8 lesen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Das erlaubt die Verwendung von Unicode in HTML-Templates, Perl-/JavaScript- und Menü-Dateien, sodass die auch vom Locale-System richtig durchgereicht werden. --- scripts/locales.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/locales.pl b/scripts/locales.pl index 682efbaf8..65bd178d4 100755 --- a/scripts/locales.pl +++ b/scripts/locales.pl @@ -387,7 +387,7 @@ sub scanfile { return unless (-f "$file"); my $fh = new FileHandle; - open $fh, "$file" or die "$! : $file"; + open $fh, '<:encoding(utf8)', $file or die "$! : $file"; my ($is_submit, $line_no, $sub_line_no) = (0, 0, 0); @@ -517,7 +517,7 @@ sub scanmenu { my $file = shift; my $fh = new FileHandle; - open $fh, "$file" or die "$! : $file"; + open $fh, '<:encoding(utf8)', $file or die "$! : $file"; my @a = grep m/^\[/, <$fh>; close($fh); @@ -551,7 +551,7 @@ sub scanhtmlfile { my %plugins = ( 'loaded' => { }, 'needed' => { } ); - if (!open(IN, $file)) { + if (!open(IN, '<:encoding(utf8)', $file)) { print "E: template file '$file' not found\n"; return; } @@ -645,7 +645,7 @@ sub scanhtmlfile { sub scan_javascript_file { my ($file) = @_; - open(my $fh, $file) || die('can not open file: '. $file); + open(my $fh, '<:encoding(utf8)', $file) || die('can not open file: '. $file); while( my $line = readline($fh) ) { while( $line =~ m/ -- 2.20.1