Decode an UTF8 email header

前端 未结 5 1585
北海茫月
北海茫月 2020-12-15 04:40

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

5条回答
  •  忘掉有多难
    2020-12-15 05:10

    MIME::Words from MIME-tools work well too for this. I ran into some issue with Encode and found MIME::Words succeeded on some strings where Encode did not.

    use MIME::Words qw(:all);
    $decoded = decode_mimewords(
        'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ',
    );
    

提交回复
热议问题