develooper Front page | perl.perl5.changes | Postings from November 2010

[perl.git] branch blead, updated. v5.13.7-106-g719245b

From:
Chris 'Bingos' Williams
Date:
November 25, 2010 16:48
Subject:
[perl.git] branch blead, updated. v5.13.7-106-g719245b
Message ID:
E1PLmTj-00060L-L6@camel.ams6.corp.booking.com
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/719245bdb37d6b755905afe0a676055044850522?hp=d4456f896c3eddd615abf6048839581863ea6ca3>

- Log -----------------------------------------------------------------
commit 719245bdb37d6b755905afe0a676055044850522
Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
Date:   Fri Nov 26 00:46:37 2010 +0000

    Update MIME-Base64 to CPAN version 3.12
    
      [DELTA]
    
      2010-10-25   Gisle Aas <gisle@ActiveState.com>
    
       Release 3.12
    
       Don't change SvUTF8 flag on the strings encoded [RT#60105]
    
       Documentation tweaks
-----------------------------------------------------------------------

Summary of changes:
 Porting/Maintainers.pl          |    2 +-
 cpan/MIME-Base64/Base64.pm      |   30 +++++++++++++-----------------
 cpan/MIME-Base64/Base64.xs      |   14 ++++++++++++--
 cpan/MIME-Base64/Changes        |   10 ++++++++++
 cpan/MIME-Base64/QuotedPrint.pm |   10 +++++-----
 cpan/MIME-Base64/README         |    2 +-
 cpan/MIME-Base64/t/unicode.t    |   25 ++++++++++++++++++-------
 pod/perldelta.pod               |    2 +-
 8 files changed, 61 insertions(+), 34 deletions(-)

diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index 89504ed..b699f0d 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -927,7 +927,7 @@ use File::Glob qw(:case);
     'MIME::Base64' =>
 	{
 	'MAINTAINER'	=> 'gaas',
-	'DISTRIBUTION'	=> 'GAAS/MIME-Base64-3.11.tar.gz',
+	'DISTRIBUTION'	=> 'GAAS/MIME-Base64-3.12.tar.gz',
 	'FILES'		=> q[cpan/MIME-Base64],
 	'EXCLUDED'	=> [ qw{ t/bad-sv.t }, ],
 	'UPSTREAM'	=> 'cpan',
diff --git a/cpan/MIME-Base64/Base64.pm b/cpan/MIME-Base64/Base64.pm
index 32d387a..c221bf1 100644
--- a/cpan/MIME-Base64/Base64.pm
+++ b/cpan/MIME-Base64/Base64.pm
@@ -8,7 +8,7 @@ require Exporter;
 @EXPORT = qw(encode_base64 decode_base64);
 @EXPORT_OK = qw(encode_base64url decode_base64url encoded_base64_length decoded_base64_length);
 
-$VERSION = '3.11';
+$VERSION = '3.12';
 
 require XSLoader;
 XSLoader::load('MIME::Base64', $VERSION);
@@ -58,24 +58,24 @@ The following primary functions are provided:
 
 =over 4
 
-=item encode_base64($str)
+=item encode_base64( $bytes )
 
-=item encode_base64($str, $eol);
+=item encode_base64( $bytes, $eol );
 
 Encode data by calling the encode_base64() function.  The first
-argument is the string to encode.  The second argument is the
+argument is the byte string to encode.  The second argument is the
 line-ending sequence to use.  It is optional and defaults to "\n".  The
 returned encoded string is broken into lines of no more than 76
 characters each and it will end with $eol unless it is empty.  Pass an
 empty string as second argument if you do not want the encoded string
 to be broken into lines.
 
-The function will croak with "Wide character in subroutine entry" if $str
+The function will croak with "Wide character in subroutine entry" if $bytes
 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.
 
-=item decode_base64($str)
+=item decode_base64( $str )
 
 Decode a base64 string by calling the decode_base64() function.  This
 function takes a single argument which is the string to decode and
@@ -85,10 +85,6 @@ Any character not part of the 65-character base64 subset is
 silently ignored.  Characters occurring after a '=' padding character
 are never decoded.
 
-If the length of the string to decode, after ignoring
-non-base64 chars, is not a multiple of 4 or if padding occurs too early,
-then a warning is generated if perl is running under C<-w>.
-
 =back
 
 If you prefer not to import these routines into your namespace, you can
@@ -102,24 +98,24 @@ Additional functions not exported by default:
 
 =over 4
 
-=item encode_base64url($str)
+=item encode_base64url( $bytes )
 
-=item decode_base64url($str)
+=item decode_base64url( $str )
 
 Encode and decode according to the base64 scheme for "URL applications" [1].
 This is a variant of the base64 encoding which does not use padding, does not
 break the string into multiple lines and use the characters "-" and "_" instead
 of "+" and "/" to avoid using reserved URL characters.
 
-=item encoded_base64_length($str)
+=item encoded_base64_length( $bytes )
 
-=item encoded_base64_length($str, $eol)
+=item encoded_base64_length( $bytes, $eol )
 
 Returns the length that the encoded string would have without actually
-encoding it.  This will return the same value as C<< length(encode_base64($str)) >>,
+encoding it.  This will return the same value as C<< length(encode_base64($bytes)) >>,
 but should be more efficient.
 
-=item decoded_base64_length($str)
+=item decoded_base64_length( $str )
 
 Returns the length that the decoded string would have without actually
 decoding it.  This will return the same value as C<< length(decode_base64($str)) >>,
@@ -170,7 +166,7 @@ example:
 
 =head1 COPYRIGHT
 
-Copyright 1995-1999, 2001-2004 Gisle Aas.
+Copyright 1995-1999, 2001-2004, 2010 Gisle Aas.
 
 This library is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.
diff --git a/cpan/MIME-Base64/Base64.xs b/cpan/MIME-Base64/Base64.xs
index 5bac9ec..695e24a 100644
--- a/cpan/MIME-Base64/Base64.xs
+++ b/cpan/MIME-Base64/Base64.xs
@@ -107,10 +107,11 @@ encode_base64(sv,...)
 	STRLEN rlen;   /* length of result string */
 	unsigned char c1, c2, c3;
 	int chunk;
+	bool utf8_downgraded;
 
 	CODE:
 #if PERL_REVISION == 5 && PERL_VERSION >= 6
-	sv_utf8_downgrade(sv, FALSE);
+	utf8_downgraded = sv_utf8_downgrade(sv, FALSE);
 #endif
 	str = SvPV(sv, rlen); /* SvPV(sv, len) gives warning for signed len */
 	len = (SSize_t)rlen;
@@ -169,6 +170,10 @@ encode_base64(sv,...)
 		*r++ = *c++;
 	}
 	*r = '\0';  /* every SV in perl should be NUL-terminated */
+#if PERL_REVISION == 5 && PERL_VERSION >= 6
+	if (utf8_downgraded)
+	    sv_utf8_upgrade(sv);
+#endif
 
 	OUTPUT:
 	RETVAL
@@ -317,10 +322,11 @@ encode_qp(sv,...)
 	char *p;
 	char *p_beg;
 	STRLEN p_len;
+	bool utf8_downgraded;
 
 	CODE:
 #if PERL_REVISION == 5 && PERL_VERSION >= 6
-	sv_utf8_downgrade(sv, FALSE);
+	utf8_downgraded = sv_utf8_downgrade(sv, FALSE);
 #endif
 	/* set up EOL from the second argument if present, default to "\n" */
 	if (items > 1 && SvOK(ST(1))) {
@@ -412,6 +418,10 @@ encode_qp(sv,...)
 	    sv_catpvn(RETVAL, "=", 1);
 	    sv_catpvn(RETVAL, eol, eol_len);
 	}
+#if PERL_REVISION == 5 && PERL_VERSION >= 6
+	if (utf8_downgraded)
+	    sv_utf8_upgrade(sv);
+#endif
 
 	OUTPUT:
 	RETVAL
diff --git a/cpan/MIME-Base64/Changes b/cpan/MIME-Base64/Changes
index bc360ca..defed05 100644
--- a/cpan/MIME-Base64/Changes
+++ b/cpan/MIME-Base64/Changes
@@ -1,3 +1,13 @@
+2010-10-25   Gisle Aas <gisle@ActiveState.com>
+
+   Release 3.12
+
+   Don't change SvUTF8 flag on the strings encoded [RT#60105]
+
+   Documentation tweaks
+
+
+
 2010-10-24   Gisle Aas <gisle@ActiveState.com>
 
    Release 3.11
diff --git a/cpan/MIME-Base64/QuotedPrint.pm b/cpan/MIME-Base64/QuotedPrint.pm
index beb9f84..398d244 100644
--- a/cpan/MIME-Base64/QuotedPrint.pm
+++ b/cpan/MIME-Base64/QuotedPrint.pm
@@ -7,7 +7,7 @@ require Exporter;
 @ISA = qw(Exporter);
 @EXPORT = qw(encode_qp decode_qp);
 
-$VERSION = "3.11";
+$VERSION = "3.12";
 
 use MIME::Base64;  # will load XS version of {en,de}code_qp()
 
@@ -44,11 +44,11 @@ The following functions are provided:
 
 =over 4
 
-=item encode_qp($str)
+=item encode_qp( $str)
 
-=item encode_qp($str, $eol)
+=item encode_qp( $str, $eol)
 
-=item encode_qp($str, $eol, $binmode)
+=item encode_qp( $str, $eol, $binmode )
 
 This function returns an encoded version of the string ($str) given as
 argument.
@@ -72,7 +72,7 @@ An $eol of "" (the empty string) is special.  In this case, no "soft
 line breaks" are introduced and binary mode is effectively enabled so
 that any "\n" in the original data is encoded as well.
 
-=item decode_qp($str);
+=item decode_qp( $str )
 
 This function returns the plain text version of the string given
 as argument.  The lines of the result are "\n" terminated, even if
diff --git a/cpan/MIME-Base64/README b/cpan/MIME-Base64/README
index fbd3d54..93eaa62 100644
--- a/cpan/MIME-Base64/README
+++ b/cpan/MIME-Base64/README
@@ -21,7 +21,7 @@ In order to install and use this package you will need Perl version
    make test
    make install
 
-Copyright 1995-1999,2001-2004 Gisle Aas <gisle@ActiveState.com>
+Copyright 1995-1999,2001-2004,2010 Gisle Aas <gisle@ActiveState.com>
 
 This library is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.
diff --git a/cpan/MIME-Base64/t/unicode.t b/cpan/MIME-Base64/t/unicode.t
index b09a328..f5dd45d 100644
--- a/cpan/MIME-Base64/t/unicode.t
+++ b/cpan/MIME-Base64/t/unicode.t
@@ -9,25 +9,36 @@ BEGIN {
         }
 }
 
-print "1..2\n";
+use Test;
+plan tests => 8;
 
 require MIME::Base64;
+require MIME::QuotedPrint;
 
 eval {
     my $tmp = MIME::Base64::encode(v300);
     print "# enc: $tmp\n";
 };
 print "# $@" if $@;
-print "not " unless $@;
-print "ok 1\n";
-
-require MIME::QuotedPrint;
+ok($@);
 
 eval {
     my $tmp = MIME::QuotedPrint::encode(v300);
     print "# enc: $tmp\n";
 };
 print "# $@" if $@;
-print "not " unless $@;
-print "ok 2\n";
+ok($@);
 
+if (defined &utf8::is_utf8) {
+    my $str = "aaa" . v300;
+    ok(utf8::is_utf8($str));
+    chop($str);
+    ok(utf8::is_utf8($str));
+    ok(MIME::Base64::encode($str, ""), "YWFh");
+    ok(utf8::is_utf8($str));
+    ok(MIME::QuotedPrint::encode($str), "aaa=\n");
+    ok(utf8::is_utf8($str));
+}
+else {
+    skip("Missing is_utf8") for 1..6;
+}
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 1738a47..b445eeb 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -136,7 +136,7 @@ and documentation enhancements.
 
 =item *
 
-C<MIME::Base64> has been upgraded from 3.10 to 3.11
+C<MIME::Base64> has been upgraded from 3.10 to 3.12
 
 Now provides encode_base64url and decode_base64url functions to process
 the base64 scheme for "URL applications".

--
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About