Skip Menu |

This queue is for tickets about the MIME-Base64 CPAN distribution.

Report information
The Basics
Id: 60105
Status: resolved
Priority: 0/
Queue: MIME-Base64

People
Owner: Nobody in particular
Requestors: FANY [...] cpan.org
Cc: 10130344 [...] ticket.noris.net
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 3.07
  • 3.09
Fixed in: (no value)



CC: 10130344 [...] ticket.noris.net
Subject: utf8::downgrade() for strings given to MIME::Base64::encode()
When an internally utf8 encoded string is given to MIME::Base64::encode(), the string gets utf8::downgrade(): - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $ cat ./mime-base64 #!/usr/local/bin/perl -w use strict; use utf8; use Devel::Peek; use MIME::Base64; my $s = 'Täst'; utf8::upgrade($s); print STDERR '$s before: '; Dump($s); print STDERR "\nbase64: " . MIME::Base64::encode($s) . "\n"; print STDERR '$s after: '; Dump($s); $ ./mime-base64 $s before: SV = PV(0x8163040) at 0x8178c28 REFCNT = 1 FLAGS = (PADMY,POK,pPOK,UTF8) PV = 0x817e890 "T\303\244st"\0 [UTF8 "T\x{e4}st"] CUR = 5 LEN = 8 base64: VORzdA== $s after: SV = PV(0x8163040) at 0x8178c28 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x817e890 "T\344st"\0 CUR = 4 LEN = 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Disclaimer: I'm not sure if this is to be considered a bug in _this_ module, since you normally would not want to pass text strings to MIME::Base64::encode(), anyway. However, at least Data::Dump::pp() does that under certain circumstances. (Cmp. bug 60103.) Regards, fany
This should not really be needed as perl should not give the state of the UTF8 flag a semantic meaning; but we are not there yet so I compensated. Ref <https://github.com/gisle/mime- base64/commit/3329b05038e9d1b916fd575a94c172a8eef15bc0>