package MIME::Base64;
-# $Id: Base64.pm,v 3.5 2004/09/20 09:23:23 gisle Exp $
+# $Id: Base64.pm,v 3.9 2005/11/26 10:47:48 gisle Exp $
use strict;
use vars qw(@ISA @EXPORT $VERSION);
require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
@EXPORT = qw(encode_base64 decode_base64);
-$VERSION = '3.05';
+$VERSION = '3.06';
-MIME::Base64->bootstrap($VERSION);
+require XSLoader;
+XSLoader::load('MIME::Base64', $VERSION);
*encode = \&encode_base64;
*decode = \&decode_base64;
=back
+The following exception can be raised:
+
+=over 4
+
+=item Wide character in subroutine entry
+
+The string passed to encode_base64() contains characters with code
+above 255. The base64 encoding is only defined for single-byte
+characters. Use the Encode module to select the byte encoding you
+want.
+
+=back
+
=head1 EXAMPLES
If you want to encode a large file, you should encode it in chunks
perl -MMIME::Base64 -ne 'print decode_base64($_)' <file
+Perl v5.8 and better allow extended Unicode characters in strings.
+Such strings cannot be encoded directly, as the base64
+encoding is only defined for single-byte characters. The solution is
+to use the Encode module to select the byte encoding you want. For
+example:
+
+ use MIME::Base64 qw(encode_base64);
+ use Encode qw(encode);
+
+ $encoded = encode_base64(encode("UTF-8", "\x{FFFF}\n"));
+ print $encoded;
+
=head1 COPYRIGHT
Copyright 1995-1999, 2001-2004 Gisle Aas.
-/* $Id: Base64.xs,v 3.4 2004/08/24 16:29:35 gisle Exp $
+/* $Id: Base64.xs,v 3.5 2005/11/26 10:44:14 gisle Exp $
Copyright 1997-2004 Gisle Aas
+2005-11-26 Gisle Aas <gisle@ActiveState.com>
+
+ Release 3.06
+
+ Documentation tweaks.
+
+ use XSLoader; perl-5.6 now required.
+
+ Some consting from bleadperl.
+
+ Unbundled the {en,de}code-{base64,qp} utility scripts.
+ These are now found in the MIME-Base64-Scripts package.
+
+
+
2004-09-20 Gisle Aas <gisle@ActiveState.com>
Release 3.05
-require 5.005;
+require 5.006;
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'MIME::Base64',
- MAN3PODS => {}, # Pods will be built by installman.
VERSION_FROM => 'Base64.pm',
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+ ($] >= 5.008) ?
+ (INSTALLDIRS => 'perl') : (),
);
package MIME::QuotedPrint;
-# $Id: QuotedPrint.pm,v 3.4 2004/08/25 09:33:45 gisle Exp $
+# $Id: QuotedPrint.pm,v 3.6 2005/11/26 10:47:48 gisle Exp $
use strict;
use vars qw(@ISA @EXPORT $VERSION);
@ISA = qw(Exporter);
@EXPORT = qw(encode_qp decode_qp);
-$VERSION = "3.03";
+$VERSION = "3.06";
use MIME::Base64; # will load XS version of {en,de}code_qp()
$encoded = MIME::QuotedPrint::encode($decoded);
$decoded = MIME::QuotedPrint::decode($encoded);
-Perl v5.6 and better allow extended Unicode characters in strings.
+Perl v5.8 and better allow extended Unicode characters in strings.
Such strings cannot be encoded directly, as the quoted-printable
-encoding is only defined for single-byte characters. The solution is to use the Encode
-module to select the byte encoding you want. For example:
+encoding is only defined for single-byte characters. The solution is
+to use the Encode module to select the byte encoding you want. For
+example:
use MIME::QuotedPrint qw(encode_qp);
use Encode qw(encode);