in reply to Re^4: Decoding an email body, into utf8
in thread Decoding an email body, into utf8

Interesting. Just found a post on StackOverflow, where someone suggested using decode_base64 to decode it. And that seems to work:

my $name = "=?UTF-8?B?QW5keSBOZXdieSDDrcOpw7M=?="; use MIME::Base64; $name =~ s|\Q=?UTF-8?B?||i; $name = decode_base64($name); $name =~ s/([\200-\377]+)/from_utf8({ -string => $1, -charset => ' +ISO-8859-1'})/eg;

I wonder why the other module doesn't work?

Cheers

Andy

Replies are listed 'Best First'.
Re^6: Decoding an email body, into utf8
by soonix (Chancellor) on Jul 30, 2016 at 06:20 UTC
    RFC 2047, section 4 says it. The "?B?" part tells you to use base 64, while "?q?" means "quoted-printable".

    Since you already know CPAN: search term is rfc 2047