From: Rafael Garcia-Suarez Date: Mon, 12 Jan 2004 22:10:51 +0000 (+0000) Subject: Upgrade to MIME::Base64 2.23. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=691d66bd80cce8a28b2441860877f52054fc5710;p=p5sagit%2Fp5-mst-13.2.git Upgrade to MIME::Base64 2.23. p4raw-id: //depot/perl@22124 --- diff --git a/ext/MIME/Base64/Base64.pm b/ext/MIME/Base64/Base64.pm index a008c7d..d0069f1 100644 --- a/ext/MIME/Base64/Base64.pm +++ b/ext/MIME/Base64/Base64.pm @@ -1,5 +1,5 @@ # -# $Id: Base64.pm,v 2.34 2003/10/09 19:15:42 gisle Exp $ +# $Id: Base64.pm,v 2.37 2004/01/08 14:07:26 gisle Exp $ package MIME::Base64; @@ -16,9 +16,9 @@ MIME::Base64 - Encoding and decoding of base64 strings =head1 DESCRIPTION -This module provides functions to encode and decode strings into the -Base64 encoding specified in RFC 2045 - I. The Base64 encoding is designed to represent +This module provides functions to encode and decode strings into and from the +base64 encoding specified in RFC 2045 - I. The base64 encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be represented per printable character. @@ -32,12 +32,12 @@ The following functions are provided: =item encode_base64($str, $eol); Encode data by calling the encode_base64() function. The first -argument is the string to encode. The second argument is the line -ending sequence to use. It is optional and defaults to "\n". The +argument is the 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 -broken into lines. +to be broken into lines. =item decode_base64($str) @@ -45,17 +45,17 @@ Decode a base64 string by calling the decode_base64() function. This function takes a single argument which is the string to decode and returns the decoded data. -Any character not part of the 65-character base64 subset set is -silently ignored. Characters occuring after a '=' padding character +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 padding occurs too early, +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 +If you prefer not to import these routines into your namespace, you can call them as: use MIME::Base64 (); @@ -64,7 +64,7 @@ call them as: =head1 DIAGNOSTICS -The following warnings might be generated if perl is invoked with the +The following warnings can be generated if perl is invoked with the C<-w> switch: =over 4 @@ -107,14 +107,14 @@ The same approach as a command line: perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' by Hans Mulder -The XS implementation use code from metamail. Copyright 1991 Bell +The XS implementation uses code from metamail. Copyright 1991 Bell Communications Research, Inc. (Bellcore) =head1 SEE ALSO @@ -141,7 +141,7 @@ require DynaLoader; @ISA = qw(Exporter DynaLoader); @EXPORT = qw(encode_base64 decode_base64); -$VERSION = '2.21'; +$VERSION = '2.23'; eval { bootstrap MIME::Base64 $VERSION; }; if ($@) { diff --git a/ext/MIME/Base64/Base64.xs b/ext/MIME/Base64/Base64.xs index 6a36766..0e1817e 100644 --- a/ext/MIME/Base64/Base64.xs +++ b/ext/MIME/Base64/Base64.xs @@ -1,6 +1,6 @@ -/* $Id: Base64.xs,v 1.38 2003/10/09 11:26:12 gisle Exp $ +/* $Id: Base64.xs,v 1.41 2004/01/08 14:07:26 gisle Exp $ -Copyright 1997-2003 Gisle Aas +Copyright 1997-2004 Gisle Aas This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -253,7 +253,7 @@ decode_base64(sv) MODULE = MIME::Base64 PACKAGE = MIME::QuotedPrint -#define qp_isplain(c) ((c) == '\t' || ((c) >= ' ' && (c) <= '~') && (c) != '=') +#define qp_isplain(c) ((c) == '\t' || (((c) >= ' ' && (c) <= '~') && (c) != '=')) SV* encode_qp(sv,...) @@ -399,7 +399,7 @@ decode_qp(sv) whitespace = 0; } if (*str == '=') { - if ((str + 2) < end && isxdigit(str[1]) && isxdigit(str[2])) { + if ((str + 2) < end && isXDIGIT(str[1]) && isXDIGIT(str[2])) { char buf[3]; str++; buf[0] = *str++; diff --git a/ext/MIME/Base64/Changes b/ext/MIME/Base64/Changes index c387caa..24b28af 100644 --- a/ext/MIME/Base64/Changes +++ b/ext/MIME/Base64/Changes @@ -1,3 +1,19 @@ +2004-01-08 Gisle Aas + + Release 2.23 + + Documentation fixes by Paul Croome . + + + +2004-01-08 Gisle Aas + + Release 2.22 + + Fix 'gcc -Wall' complaints. + + + 2003-10-09 Gisle Aas Release 2.21 diff --git a/ext/MIME/Base64/QuotedPrint.pm b/ext/MIME/Base64/QuotedPrint.pm index 6988a8d..db78330 100644 --- a/ext/MIME/Base64/QuotedPrint.pm +++ b/ext/MIME/Base64/QuotedPrint.pm @@ -1,5 +1,5 @@ # -# $Id: QuotedPrint.pm,v 2.17 2003/10/09 19:04:29 gisle Exp $ +# $Id: QuotedPrint.pm,v 2.19 2004/01/08 14:07:26 gisle Exp $ package MIME::QuotedPrint; @@ -16,12 +16,12 @@ MIME::QuotedPrint - Encoding and decoding of quoted-printable strings =head1 DESCRIPTION -This module provides functions to encode and decode strings into the -Quoted-Printable encoding specified in RFC 2045 - I. The Quoted-Printable encoding is intended +This module provides functions to encode and decode strings into and from the +quoted-printable encoding specified in RFC 2045 - I. The quoted-printable encoding is intended to represent data that largely consists of bytes that correspond to -printable characters in the ASCII character set. Non-printable -characters (as defined by english americans) are represented by a +printable characters in the ASCII character set. Each non-printable +character (as defined by English Americans) is represented by a triplet consisting of the character "=" followed by two hexadecimal digits. @@ -33,30 +33,30 @@ The following functions are provided: =item encode_qp($str, $eol) -This function will return an encoded version of the string given as +This function returns an encoded version of the string given as argument. -The second argument is the line ending sequence to use. It is -optional and defaults to "\n". Every occurence of "\n" will be -replaced with this string and it will also be used for additional +The second argument is the line-ending sequence to use. It is +optional and defaults to "\n". Every occurrence of "\n" is +replaced with this string, and it is also used for additional "soft line breaks" to ensure that no line is longer than 76 characters. You might want to pass it as "\015\012" to produce data -suitable external consumption. The string "\r\n" will produce the +suitable for external consumption. The string "\r\n" produces the same result on many platforms, but not all. -An $eol of "" special. If passed no "soft line breaks" are introduced +An $eol of "" (the empty string) is special. In this case, no "soft line breaks" are introduced and any literal "\n" in the original data is encoded as well. =item decode_qp($str); -This function will return the plain text version of the string given -as argument. The lines of the result will be "\n" terminated even it +This function returns the plain text version of the string given +as argument. The lines of the result are "\n" terminated, even if the $str argument contains "\r\n" terminated lines. =back -If you prefer not to import these routines into your namespace you can +If you prefer not to import these routines into your namespace, you can call them as: use MIME::QuotedPrint (); @@ -64,8 +64,8 @@ call them as: $decoded = MIME::QuotedPrint::decode($encoded); Perl v5.6 and better allow extended Unicode characters in strings. -Such strings cannot be encoded directly as the quoted-printable -encoding is only defined for bytes. The solution is to use the Encode +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: use MIME::QuotedPrint qw(encode_qp); @@ -76,7 +76,7 @@ module to select the byte encoding you want. For example: =head1 COPYRIGHT -Copyright 1995-1997,2002-2003 Gisle Aas. +Copyright 1995-1997,2002-2004 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.