Subject: | Unicode issue when calling encode_qp() - somehow related to #39334 |
Date: | Sun, 22 Feb 2009 21:21:29 +0100 |
To: | bug-MIME-Lite [...] rt.cpan.org |
From: | kmx <kmx [...] volny.cz> |
Hi,
my bug report regards MIMI::Lite 3.024 (perl 5.8.8).
I have experienced a very similar issue to that one reported as #39334.
The funny was that previous version (without patch for #39334) works
fine for me.
There is an issue when you are gonna encode UTF-8 string in the
following section:
### Encode it line by line:
while ( $untainted =~ m{^(.*[\r\n]*)}smg ) {
### have to do it line by line...
my $line = $1; # copy to avoid weird bug; rt 39334
$out->print( encode_qp($line) );
}
If we use a sequence:
- my $line = $1;
- $out->print( encode_qp($line) );
the variable $line has UTF8 flag set, however before patch for #39334
the sequence
- $out->print( encode_qp($1) );
uses variable $1 that has not UTF8 flag set.
The problem is that MIME::QuotedPrint::encode_qp() behaves differently
if the argument is a perl string with/without UTF8 flag.
The solution for me was to set PARANOID=1 and use MIMI::Lite
implementation of encode_qp().
--
KMX