changeset 176 | 6d3c3db11e72 |
175:266a7e9b9237 | 176:6d3c3db11e72 |
---|---|
1 # $Id: UnicodeExt.pm,v 1.4 2003/07/30 13:39:23 matt 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 Encode::from_to($_[0], $_[1], "utf-8"); |
|
20 } |
|
21 |
|
22 1; |
|
23 |