Revert "Always propagate encoding from ACE to GnuPG and set default (latin-1)...

Revert "Always propagate encoding from ACE to GnuPG and set default (latin-1) value to configuration"

This reverts commit 046bee4f
parent 046bee4f
Pipeline #2563 failed with stages
in 3 minutes and 33 seconds
......@@ -289,7 +289,7 @@ class Config:
'positive_184_ack': [opt_bool, False, _('If enabled, Gajim will show an icon to show that sent message has been received by your contact')],
'show_avatar_in_tabs': [opt_bool, False, _('Show a mini avatar in chat window tabs and in window icon')],
'use_keyring': [opt_bool, True, _('If true, Gajim will use the Systems Keyring to store account passwords.')],
'pgp_encoding': [opt_str, 'latin-1', _('Sets the encoding used by python-gnupg'), True],
'pgp_encoding': [opt_str, '', _('Sets the encoding used by python-gnupg'), True],
'remote_commands': [opt_bool, False, _('If true, Gajim will execute XEP-0146 Commands.')],
'dark_theme': [opt_int, 2, _('2: System, 1: Enabled, 0: Disabled')],
'threshold_options': [opt_str, '1, 2, 4, 10, 0', _('Options in days which can be chosen in the sync threshold menu'), True],
......
......@@ -43,7 +43,9 @@ if app.is_installed('GPG'):
def __init__(self):
use_agent = app.config.get('use_gpg_agent')
gnupg.GPG.__init__(self, gpgbinary=app.get_gpg_binary(), use_agent=use_agent)
self.encoding = app.config.get('pgp_encoding', 'latin-1')
encoding = app.config.get('pgp_encoding')
if encoding:
self.encoding = encoding
self.decode_errors = 'replace'
self.passphrase = None
self.always_trust = [] # list of keyID to always trust
......@@ -161,7 +163,7 @@ if app.is_installed('GPG'):
"""Check passphrase against key with given ID"""
try:
passphrase.encode(self.encoding)
passphrase.encode("latin-1")
except UnicodeEncodeError:
return GPGKeyState.BROKEN_PASSPHRASE_ENCODING
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment