omemo / python-omemo

Python OMEMO Library
GNU General Public License v3.0
42 stars 6 forks source link

UnicodeEncodeError on Umlauts #14

Closed ReneVolution closed 7 years ago

ReneVolution commented 7 years ago

Whenever i try to encrypt german umlauts, it runs into UnicodeEncodeError.

02/01/2017 22:26:11: stderr: ERR: File "/usr/local/lib/python2.7/dist-packages/omemo/state.py", line 279, in create_msg 02/01/2017 22:26:11: stderr: ERR: (key, iv, payload) = encrypt(plaintext) 02/01/2017 22:26:11: stderr: ERR: File "/usr/local/lib/python2.7/dist-packages/omemo/aes_gcm.py", line 37, in encrypt 02/01/2017 22:26:11: stderr: ERR: encoded_plaintext = padding_add(plaintext).encode() 02/01/2017 22:26:11: stderr: ERR: UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 28: ordinal not in range(128)

ReneVolution commented 7 years ago

In https://github.com/omemo/python-omemo/blob/master/src/omemo/aes_gcm.py#L37 we should use

.encode('utf-8')

kalkin commented 7 years ago

Hi, I don't have the time to actively develop this, but patches are welcome and will be reviewed and accepted by me.

ReneVolution commented 7 years ago

Fixed.