Upgrade to MIME-Base64-3.06
[p5sagit/p5-mst-13.2.git] / ext / MIME / Base64 / Base64.pm
index f795015..5204e83 100644 (file)
@@ -1,18 +1,18 @@
 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;
@@ -101,6 +101,19 @@ in a base64 quartet.
 
 =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
@@ -130,6 +143,18 @@ of four base64 chars:
 
    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.