summaryrefslogtreecommitdiff
path: root/ext/MIME/Base64/QuotedPrint.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-07-09 00:17:49 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-07-09 00:17:49 +0000
commitb13872386a1592fb39e4c9e14ec614f70a5c8533 (patch)
tree81efd9e23a56c0f102313e6c860b5a98c8a9d4b6 /ext/MIME/Base64/QuotedPrint.pm
parent4afb7519d86e52b18cb15a8ff307f1cc0cfb8e0f (diff)
downloadperl-b13872386a1592fb39e4c9e14ec614f70a5c8533.tar.gz
MIME::QuotedPrint is for bytes only; from Gisle.
p4raw-id: //depot/perl@17429
Diffstat (limited to 'ext/MIME/Base64/QuotedPrint.pm')
-rw-r--r--ext/MIME/Base64/QuotedPrint.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/MIME/Base64/QuotedPrint.pm b/ext/MIME/Base64/QuotedPrint.pm
index 0b93f2062f..ad0d7e1313 100644
--- a/ext/MIME/Base64/QuotedPrint.pm
+++ b/ext/MIME/Base64/QuotedPrint.pm
@@ -72,11 +72,16 @@ require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(encode_qp decode_qp);
+use Carp qw(croak);
+
$VERSION = sprintf("%d.%02d", q$Revision: 2.3 $ =~ /(\d+)\.(\d+)/);
sub encode_qp ($)
{
my $res = shift;
+ croak("The Quoted-Printable encoding is only defined for bytes")
+ if $res =~ /[^\0-\xFF]/;
+
# Do not mention ranges such as $res =~ s/([^ \t\n!-<>-~])/sprintf("=%02X", ord($1))/eg;
# since that will not even compile on an EBCDIC machine (where ord('!') > ord('<')).
if (ord('A') == 193) { # EBCDIC style machine