author | Dario Sestito <darios@symbian.org> |
Fri, 09 Apr 2010 14:05:04 +0100 | |
changeset 231 | 914d8060176c |
parent 177 | 6d3c3db11e72 |
permissions | -rw-r--r-- |
177 | 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 |