summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-07-28 10:56:36 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-07-28 10:56:36 +0200
commit5ed0b385c11f040af99a992ba23c9947adbda7bf (patch)
tree06723c891e6a38cd806f02db2e1c7d69d7aa059d
parent45b6905896f63b1e4deb37e6ef22daf5e261a6ce (diff)
downloadbin-5ed0b385c11f040af99a992ba23c9947adbda7bf.tar.gz
bin-5ed0b385c11f040af99a992ba23c9947adbda7bf.tar.xz
masterkey.pl: Fix unicode handling of subject
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xmasterkey.pl6
1 files 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/^(?<name>.*?) (?:\((?<comment>.*?)\) )?\<(?<email>.*?@.*?)\>$/) {
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',