Alex Rivera | Logout

Decode an UTF8 email header

Asked 2008-09-24T08:45:35.703
26

I have an email subject of the form:

=?utf-8?B?T3.....?=

The body of the email is utf-8 base64 encoded - and has decoded fine. I am current using Perl's Email::MIME module to decode the email.

What is the meaning of the =?utf-8 delimiter and how do I extract information from this string?

Edit
Report

1 Answer

16

I think that the Encode module handles that with the MIME-Header encoding, so try this:

use Encode qw(decode);
my $decoded = decode("MIME-Header", $encoded);
answered 2008-09-24T08:57:18.453

Your Answer