changeset 906 | 5239d4d0bed1 |
parent 905 | 9ed73a51c728 |
child 907 | bab81256b297 |
905:9ed73a51c728 | 906:5239d4d0bed1 |
---|---|
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 |