author | Dario Sestito <darios@symbian.org> |
Wed, 03 Mar 2010 16:51:26 +0000 | |
changeset 176 | 6d3c3db11e72 |
permissions | -rw-r--r-- |
176 | 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 |