line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Encode::MAB2; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
26736
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
100
|
|
4
|
|
|
|
|
|
|
our $VERSION = "0.06"; |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
2004
|
use Encode (); |
|
2
|
|
|
|
|
34543
|
|
|
2
|
|
|
|
|
44
|
|
7
|
2
|
|
|
2
|
|
1176
|
use Encode::MAB2table; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
72
|
|
8
|
2
|
|
|
2
|
|
119983
|
use Unicode::Normalize qw(NFC); |
|
2
|
|
|
|
|
6616
|
|
|
2
|
|
|
|
|
271
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
22
|
use base qw(Encode::Encoding); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
962
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->Define('MAB2', 'mab2'); |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
1
|
0
|
sub needs_lines {1} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $combinings = qr/[\xc0-\xdb\xdd-\xdf]/; |
16
|
|
|
|
|
|
|
sub decode { |
17
|
3
|
|
|
3
|
1
|
2062
|
my($obj, $str, $chk) = @_; |
18
|
3
|
50
|
|
|
|
13
|
return unless defined $str; |
19
|
3
|
|
|
|
|
15
|
$str =~ s{\xcd\xc9}{\xcd}g; # Fehler bei Heged"us, Erd"os und Mez"o |
20
|
3
|
50
|
|
|
|
60
|
$str =~ s{($combinings+)(.)}{($2 eq "\xf5" ? "i" : $2) . $1}ge; #}; |
|
9
|
|
|
|
|
53
|
|
21
|
3
|
50
|
|
|
|
12
|
if ($chk) { |
22
|
0
|
0
|
|
|
|
0
|
if ($str =~ s/($combinings+)\z//) { |
23
|
0
|
|
|
|
|
0
|
$_[1] = $1; # we have 'sub needs_lines {1}', so this should |
24
|
|
|
|
|
|
|
# never happen |
25
|
|
|
|
|
|
|
} else { |
26
|
0
|
|
|
|
|
0
|
$_[1] = ''; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
3
|
|
|
|
|
14
|
NFC(Encode::decode("MAB2table",$str)); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
__END__ |