use utf8 encoded characters for substitution of German umlauts

This commit is contained in:
vuffiraa72 2019-08-09 19:31:24 +02:00
parent 77c6350b0b
commit 1f4156388d

View File

@ -3535,18 +3535,18 @@ sub CheckIfShuttersWindowRecOpen($) {
sub makeReadingName($) { sub makeReadingName($) {
my ($rname) = @_; my ($rname) = @_;
my %charHash = ( my %charHash = (
"ä" => "ae", chr(0xe4) => "ae", # ä
"Ä" => "Ae", chr(0xc4) => "Ae", # Ä
"ü" => "ue", chr(0xfc) => "ue", # ü
"Ü" => "Ue", chr(0xdc) => "Ue", # Ü
"ö" => "oe", chr(0xf6) => "oe", # ö
"Ö" => "Oe", chr(0xd6) => "Oe", # Ö
"ß" => "ss" chr(0xdf) => "ss" # ß
); );
my $charHashkeys = join( "|", keys(%charHash) ); my $charHashkeys = join( "", keys(%charHash) );
return $rname if ( $rname =~ m/^\./ ); return $rname if ( $rname =~ m/^\./ );
$rname =~ s/($charHashkeys)/$charHash{$1}/gi; $rname =~ s/([$charHashkeys])/$charHash{$1}/gi;
$rname =~ s/[^a-z0-9._\-\/]/_/gi; $rname =~ s/[^a-z0-9._\-\/]/_/gi;
return $rname; return $rname;
} }