From 51c0ea34a70dc94869cd23975c6578dba079d05e Mon Sep 17 00:00:00 2001 From: revsuine Date: Mon, 4 Nov 2024 23:55:56 +0000 Subject: [PATCH] use utf-8 encoding for gpg encryption --- gpgmymail | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpgmymail b/gpgmymail index 908cb61..f0f1f5b 100755 --- a/gpgmymail +++ b/gpgmymail @@ -68,7 +68,9 @@ def encrypt( if is_message_encrypted(message) and not unconditionally_encrypt: return message.as_string() - encrypted_content = gnupg.GPG().encrypt(message.as_string(), recipients, armor=True) + gpg = gnupg.GPG() + gpg.encoding = 'utf-8' # default is latin-1 which fails w some unicode chars + encrypted_content = gpg.encrypt(message.as_string(), recipients, armor=True) if not encrypted_content: raise ValueError(encrypted_content.status)