Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / lib / perl5 / 5.8.8 / DBM_Filter / utf8.pm
CommitLineData
920dae64
AT
1package DBM_Filter::utf8 ;
2
3use strict;
4use warnings;
5use Carp;
6
7our $VERSION = '0.01';
8
9BEGIN
10{
11 eval { require Encode; };
12
13 croak "Encode module not found.\n"
14 if $@;
15}
16
17sub Store { $_ = Encode::encode_utf8($_) if defined $_ }
18
19sub Fetch { $_ = Encode::decode_utf8($_) if defined $_ }
20
211;
22
23__END__
24
25=head1 DBM_Filter::utf8
26
27=head1 SYNOPSIS
28
29 use SDBM_File; # or DB_File, or GDBM_File, or NDBM_File, or ODBM_File
30 use DBM_Filter ;
31
32
33 $db = tie %hash, ...
34 $db->Filter_Push('utf8');
35
36=head1 DESCRIPTION
37
38This Filter will ensure that all data written to the DBM will be encoded
39in UTF-8.
40
41This module uses the Encode module.
42
43=head1 SEE ALSO
44
45L<DBM_Filter>, L<perldbmfilter>, L<Encode>
46
47=head1 AUTHOR
48
49Paul Marquess pmqs@cpan.org
50