version 1.1, 2019/02/26 14:42:22
|
version 1.2, 2019/03/02 23:08:51
|
Line 60 use strict;
|
Line 60 use strict;
|
use utf8; |
use utf8; |
use Text::Unidecode qw(unidecode); |
use Text::Unidecode qw(unidecode); |
use Encode qw(decode_utf8 encode_utf8); |
use Encode qw(decode_utf8 encode_utf8); |
|
use Unicode::Normalize qw(normalize); |
|
|
=pod |
=pod |
|
|
Line 90 language code has an appropriate value.
|
Line 91 language code has an appropriate value.
|
sub fname_to_ascii { |
sub fname_to_ascii { |
my ($fname,$language) = @_; |
my ($fname,$language) = @_; |
if ($fname =~ /([^\x{00}-\x{7f}])/) { |
if ($fname =~ /([^\x{00}-\x{7f}])/) { |
$fname=&decode_utf8($fname); |
$fname = decode_utf8($fname); |
|
$fname = normalize('D',$fname); |
|
$fname = normalize('C',$fname); |
if ($language eq 'de') { |
if ($language eq 'de') { |
$fname = &german_to_ascii($fname); |
$fname = &german_to_ascii($fname); |
} |
} |
$fname = unidecode($fname); |
$fname = unidecode($fname); |
$fname=&encode_utf8($fname); |
$fname = encode_utf8($fname); |
} |
} |
return $fname; |
return $fname; |
} |
} |