Fixing things around
[dbsrgits/DBM-Deep.git] / lib / DBM / Deep / Cookbook.pod
CommitLineData
d8db2929 1=head1 NAME
2
3DBM::Deep::Cookbook
4
5=head1 DESCRIPTION
6
7This is the Cookbook for L<DBM::Deep/>. It contains useful tips and tricks,
8plus some examples of how to do common tasks.
9
10=head1 RECIPES
11
12=head2 UTF8 data
13
14When you're using UTF8 data, you may run into the "Wide character in print"
15warning. To fix that in 5.8+, do the following:
16
17 my $db = DBM::Deep->new( ... );
18 binmode $db->_fh, ":utf8";
19
20In 5.6, you will have to do the following:
21
22 my $db = DBM::Deep->new( ... );
23 $db->set_filter( 'store_value' => sub { pack "U0C*", unpack "C*", $_[0] } );
24 $db->set_filter( 'retrieve_value' => sub { pack "C*", unpack "U0C*", $_[0] } );
25
26In a future version, you will be able to specify C<utf8 =E<gt> 1> and
27L<DBM::Deep/> will do these things for you.
28
29=end