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   287 use 5.008;
  14         55  
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   82 use strict;
  14         24  
  14         479  
7 14     14   68 use warnings;
  14         54  
  14         931  
8 14     14   92 use Pod::Simple;
  14         22  
  14         523  
9 14     14   84 use Encode;
  14         32  
  14         6089  
10             our $VERSION = '3.47';
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 9 return Encode::->encodings(':all');
17             }
18              
19             sub encoding_is_available {
20 54     54 0 262 return Encode::resolve_alias($_[1]);
21             }
22              
23             sub encmodver {
24 2   50 2 0 10 return "Encode.pm v" .($Encode::VERSION || '?');
25             }
26              
27             sub make_transcoder {
28 52     52 0 201 my $e = Encode::find_encoding($_[1]);
29 52 50       1025 die "WHAT ENCODING!?!?" unless $e;
30 52         92 my $x;
31             return sub {
32 1850     1850   3358 foreach $x (@_) {
33 1954 100       9811 $x = $e->decode($x) unless Encode::is_utf8($x);
34             }
35 1850         21092 return;
36 52         382 };
37             }
38              
39              
40             1;
41              
42