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 15     15   301 use 5.008;
  15         53  
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 15     15   125 use strict;
  15         23  
  15         471  
7 15     15   60 use warnings;
  15         146  
  15         912  
8 15     15   77 use Pod::Simple;
  15         28  
  15         489  
9 15     15   113 use Encode;
  15         28  
  15         4825  
10             our $VERSION = '3.48';
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 8 return Encode::->encodings(':all');
17             }
18              
19             sub encoding_is_available {
20 62     62 0 243 return Encode::resolve_alias($_[1]);
21             }
22              
23             sub encmodver {
24 2   50 2 0 11 return "Encode.pm v" .($Encode::VERSION || '?');
25             }
26              
27             sub make_transcoder {
28 60     60 0 151 my $e = Encode::find_encoding($_[1]);
29 60 50       827 die "WHAT ENCODING!?!?" unless $e;
30 60         91 my $x;
31             return sub {
32 1902     1902   2413 foreach $x (@_) {
33 2022 100       7019 $x = $e->decode($x) unless Encode::is_utf8($x);
34             }
35 1902         11811 return;
36 60         333 };
37             }
38              
39              
40             1;
41              
42