[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] bug in MIME::QuotedPrint ?



I think the Perl module MIME::QuotedPrint gives wrong results
under MacPerl. I tested the following with QuotedPrint.pm from
standard installation and from cpan-mac.

#!perl -w

use MIME::QuotedPrint;

$string = "ä";
$estring = encode_qp( $string );
print "encode_qp( $string ) = $estring\n";

__END__

Result is
encode_qp( ä ) = =8A

Running under Linux I get the proper result
encode_qp( ä ) = =E4


Looking into the source code I find
...
$res =~ s/([^ \t\n!-<>-~])/sprintf("=%02X", ord($1))/eg;  # rule #2,#3
$res =~ s/([ \t]+)$/
	join('', map { sprintf("=%02X", ord($_)) }
		split('', $1)
      )/egm;                        # rule #3 (encode whitespace at eol)
...

Not understanding this fully I suspect the ord() function.

Can anybody confirm this?
Any ideas for a workaround?


Regards


Axel
----------------------------------------------------------------------
Axel Rose, Springer & Jacoby Digital GmbH & Co. KG, mailto:rose@sj.com
  pub PGP key 1024/A21CB825 E0E4 BC69 E001 96E9  2EFD 86CA 9CA1 AAC5
  "... denn alles, was entsteht, ist wert, daß es zugrunde geht ..."

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org