This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Don't prefix posix props with Is
[perl5.git] / lib / DBM_Filter / utf8.pm
CommitLineData
0e9b1cbd
PM
1package DBM_Filter::utf8 ;
2
3use strict;
4use warnings;
5use Carp;
6
ae8d64f5 7our $VERSION = '0.02';
0e9b1cbd
PM
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
b370a9eb
RGS
25=head1 NAME
26
27DBM_Filter::utf8 - filter for DBM_Filter
0e9b1cbd
PM
28
29=head1 SYNOPSIS
30
31 use SDBM_File; # or DB_File, or GDBM_File, or NDBM_File, or ODBM_File
32 use DBM_Filter ;
0e9b1cbd
PM
33
34 $db = tie %hash, ...
35 $db->Filter_Push('utf8');
b370a9eb 36
0e9b1cbd
PM
37=head1 DESCRIPTION
38
39This Filter will ensure that all data written to the DBM will be encoded
40in UTF-8.
41
42This module uses the Encode module.
43
44=head1 SEE ALSO
45
46L<DBM_Filter>, L<perldbmfilter>, L<Encode>
47
48=head1 AUTHOR
49
50Paul Marquess pmqs@cpan.org
51