File Coverage

blib/lib/XML/SAX/PurePerl/Reader/UnicodeExt.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 3 0.0
total 20 23 86.9


line stmt bran cond sub pod time code
1             # $Id$
2              
3             package XML::SAX::PurePerl::Reader;
4 14     14   86 use strict;
  14         25  
  14         381  
5              
6 14     14   6584 use Encode ();
  14         122369  
  14         1526  
7              
8             sub set_raw_stream {
9 21     21 0 43 my ($fh) = @_;
10 21         114 binmode($fh, ":bytes");
11             }
12              
13             sub switch_encoding_stream {
14 14     14 0 32 my ($fh, $encoding) = @_;
15 14     4   265 binmode($fh, ":encoding($encoding)");
  4         2045  
  4         51  
  4         19  
16             }
17              
18             sub switch_encoding_string {
19 17     17 0 63 $_[0] = Encode::decode($_[1], $_[0]);
20             }
21              
22             1;
23