use utf-8 encoding for gpg encryption
This commit is contained in:
parent
3338035673
commit
51c0ea34a7
1 changed files with 3 additions and 1 deletions
|
@ -68,7 +68,9 @@ def encrypt(
|
||||||
if is_message_encrypted(message) and not unconditionally_encrypt:
|
if is_message_encrypted(message) and not unconditionally_encrypt:
|
||||||
return message.as_string()
|
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:
|
if not encrypted_content:
|
||||||
raise ValueError(encrypted_content.status)
|
raise ValueError(encrypted_content.status)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue