Commit | Line | Data |
---|---|---|
3fea05b9 | 1 | # $Id: UnicodeExt.pm,v 1.5 2008-08-04 10:04:54 grant Exp $ |
2 | ||
3 | package XML::SAX::PurePerl::Reader; | |
4 | use strict; | |
5 | ||
6 | use Encode (); | |
7 | ||
8 | sub set_raw_stream { | |
9 | my ($fh) = @_; | |
10 | binmode($fh, ":bytes"); | |
11 | } | |
12 | ||
13 | sub switch_encoding_stream { | |
14 | my ($fh, $encoding) = @_; | |
15 | binmode($fh, ":encoding($encoding)"); | |
16 | } | |
17 | ||
18 | sub switch_encoding_string { | |
19 | $_[0] = Encode::decode($_[1], $_[0]); | |
20 | } | |
21 | ||
22 | 1; | |
23 |