1 2 3 4 5 6 7 8 9 10 11 12 13 14
sub formatNames { my $obj = shift; my $type = shift; my %sChar = ("ä" => "ae", "Ä" => "Ae", "ü" => "ue", "Ü" => "Ue", "ö" => "oe", "Ö" => "Oe", "ß" => "ss" ); my $replacement = join ("|", keys(%sChar)); if ($type eq 'filename') { my $filename = $obj->{DATA}{name}; $filename =~ s/\s*//g; $filename =~ s/($replacement)/$sChar{$1}/g; $obj->{DATA}{filename} = $filename; return }
1 2 3 4 5 6 7 8 9 10 11 12
#! /usr/bin/perl # Skript *muss* utf8 kodiert sein und die Sonderzeichen muessen korrekt vorliegen use strict; use warnings; use utf8; my %replace = ( # Umlaute MUESSEN als utf8 eingegeben vorliegen 'ä' => 'ae', );
1 2 3 4 5 6 7 8 9
#! /usr/bin/perl use strict; use warnings; my %replace = ( # Umlaute MUESSEN als utf8 eingegeben vorliegen "\N{LATIN SMALL LETTER A WITH DIAERESIS}" => 'ae', );