File Coverage

blib/lib/Pod/Simple/TranscodeSmart.pm
Criterion Covered Total %
statement 24 26 92.3
branch 3 4 75.0
condition 1 2 50.0
subroutine 10 12 83.3
pod 0 6 0.0
total 38 50 76.0


line stmt bran cond sub pod time code
1 14     14   322 use 5.008;
  14         60  
2             ## Anything before 5.8.0 is GIMPY!
3             ## This module is to be use()'d only by Pod::Simple::Transcode
4              
5             package Pod::Simple::TranscodeSmart;
6 14     14   98 use strict;
  14         31  
  14         356  
7 14     14   76 use warnings;
  14         29  
  14         528  
8 14     14   87 use Pod::Simple;
  14         25  
  14         427  
9 14     14   8579 use Encode;
  14         149222  
  14         3611  
10             our $VERSION = '3.45';
11              
12 0     0 0 0 sub is_dumb {0}
13 0     0 0 0 sub is_smart {1}
14              
15             sub all_encodings {
16 2     2 0 13 return Encode::->encodings(':all');
17             }
18              
19             sub encoding_is_available {
20 54     54 0 217 return Encode::resolve_alias($_[1]);
21             }
22              
23             sub encmodver {
24 2   50 2 0 18 return "Encode.pm v" .($Encode::VERSION || '?');
25             }
26              
27             sub make_transcoder {
28 52     52 0 152 my $e = Encode::find_encoding($_[1]);
29 52 50       1074 die "WHAT ENCODING!?!?" unless $e;
30 52         89 my $x;
31             return sub {
32 1850     1850   3036 foreach $x (@_) {
33 1954 100       9287 $x = $e->decode($x) unless Encode::is_utf8($x);
34             }
35 1850         18663 return;
36 52         353 };
37             }
38              
39              
40             1;
41              
42