line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Cleaner::Utf8; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
927
|
use Encode qw(decode encode is_utf8); |
|
1
|
|
|
|
|
11150
|
|
|
1
|
|
|
|
|
258
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = 0.0.1; |
9
|
|
|
|
|
|
|
our $DEFAULT = ''; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub _validate { |
12
|
2
|
|
|
2
|
|
11
|
my $decoded = decode($_[0]->get_encoding, $_[1]); |
13
|
2
|
100
|
66
|
|
|
234
|
is_utf8($decoded) && ($decoded eq $_[1]) ? return $decoded : return undef; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _fix { |
17
|
1
|
|
|
1
|
|
5
|
my $encoded = encode('UTF-8', $_[1]); |
18
|
1
|
|
|
|
|
33
|
return $encoded; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _format { |
22
|
0
|
|
|
0
|
|
|
my $encoded = encode('UTF-8', $_[1]); |
23
|
0
|
|
|
|
|
|
return $encoded; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |