![]() |
![]() |
3 Einträge, 1 Seite |
1
2
use Encode qw(decode);
$string_perl_intern = decode("shiftjis", $string_japanisches_encoding);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use charnames ();
binmode STDOUT, ":utf8"; # nicht unbedingt nötig
my $string = "bla foo \x{30a1}\x{30a2}\x{30AB} bar"; # die \x{....}-Zeichen bekommst du automatisch bei der Konvertierung mit Encode::decode
for (split //, $string) {
my $charname = charnames::viacode(ord $_);
if ($charname =~ /^KATAKANA LETTER (SMALL )?(.*)/) {
my $small = $1;
my $translit = $2;
if ($small) {
print lc $translit;
} else {
print ucfirst lc $translit;
}
} else {
print $_;
}
}
![]() |
![]() |
3 Einträge, 1 Seite |