[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-unattended/var/se3/unattended/install/linuxaux/opt/perl/lib/5.10.0/DBM_Filter/ -> utf8.pm (source)

   1  package DBM_Filter::utf8 ;
   2  
   3  use strict;
   4  use warnings;
   5  use Carp;
   6  
   7  our $VERSION = '0.01';
   8  
   9  BEGIN
  10  {
  11      eval { require Encode; };
  12  
  13      croak "Encode module not found.\n"
  14          if $@;
  15  }
  16  
  17  sub Store { $_ = Encode::encode_utf8($_) if defined $_ }
  18  
  19  sub Fetch { $_ = Encode::decode_utf8($_) if defined $_ }
  20  
  21  1;
  22  
  23  __END__
  24  
  25  =head1 NAME
  26  
  27  DBM_Filter::utf8 - filter for DBM_Filter
  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 ;
  33  
  34      $db = tie %hash, ...
  35      $db->Filter_Push('utf8');
  36  
  37  =head1 DESCRIPTION
  38  
  39  This Filter will ensure that all data written to the DBM will be encoded
  40  in UTF-8.
  41  
  42  This module uses the Encode module.
  43  
  44  =head1 SEE ALSO
  45  
  46  L<DBM_Filter>, L<perldbmfilter>, L<Encode>
  47  
  48  =head1 AUTHOR
  49  
  50  Paul Marquess pmqs@cpan.org
  51  


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1