line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Encode::UTF8Mac; |
2
|
2
|
|
|
2
|
|
206650
|
use 5.008001; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
143
|
|
3
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
81
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
107
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
990
|
use Encode (); |
|
2
|
|
|
|
|
12939
|
|
|
2
|
|
|
|
|
43
|
|
8
|
2
|
|
|
2
|
|
3813
|
use Unicode::Normalize::Mac; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
108
|
|
9
|
2
|
|
|
2
|
|
8
|
use base qw(Encode::Encoding); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
513
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->Define(qw(utf-8-mac)); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $utf8 = Encode::find_encoding('utf-8'); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub decode($$;$) { |
16
|
1
|
|
|
1
|
1
|
101
|
my ($self, $octets, $check) = @_; |
17
|
1
|
50
|
|
|
|
4
|
return unless defined $octets; |
18
|
1
|
|
33
|
|
|
26
|
my $string = $utf8->decode($octets, $check || Encode::FB_DEFAULT); |
19
|
1
|
|
|
|
|
35
|
$string = Unicode::Normalize::Mac::NFC($string); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub encode($$;$) { |
23
|
5377
|
|
|
5377
|
1
|
3175575
|
my ($self, $string, $check) = @_; |
24
|
5377
|
50
|
|
|
|
12804
|
return unless defined $string; |
25
|
5377
|
50
|
|
|
|
9891
|
$string .= '' if ref $string; |
26
|
5377
|
|
|
|
|
13915
|
$string = Unicode::Normalize::Mac::NFD($string); |
27
|
5377
|
|
33
|
|
|
46468
|
$utf8->encode($string, $check || Encode::FB_DEFAULT); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
__END__ |