From 5ed0b385c11f040af99a992ba23c9947adbda7bf Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 28 Jul 2018 10:56:36 +0200 Subject: masterkey.pl: Fix unicode handling of subject Signed-off-by: Florian Pritz --- masterkey.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/masterkey.pl b/masterkey.pl index 7874d16..13c89d4 100755 --- a/masterkey.pl +++ b/masterkey.pl @@ -136,7 +136,7 @@ sub gpg_get_user { die "No key found" if 0+@keys == 0; - my $user = $keys[0]->user_ids_ref->[0]->as_string; + my $user = Encode::decode('utf8', $keys[0]->user_ids_ref->[0]->as_string); unless ($user =~ m/^(?.*?) (?:\((?.*?)\) )?\<(?.*?@.*?)\>$/) { die "Failed to parse GPG user information for key $key; got $user"; @@ -178,10 +178,10 @@ sub build_email { ); my $msg = MIME::Entity->build( - From => Encode::encode('iso-8859-1', $sender_name). " <$sender_addr>", + From => Encode::encode('MIME-Header', $sender_name). " <$sender_addr>", To => $recipient_addr, BCC => $sender_addr, - Subject => Encode::encode('iso-8859-1', $subject), + Subject => Encode::encode('MIME-Header', $subject), # TODO: necessary? #TimeZone => 'Europe/Vienna', Encoding => 'quoted-printable', -- cgit v1.2.3-24-g4f1b