$ perl -Mstrict -MEncode -wE 'my $str="foo"; say encode("MIME-Header", $str);' =?UTF-8?B?Zm9v?=