From 7b6aeaec364a47352f7c2fb72974ad9d544f442e Mon Sep 17 00:00:00 2001 From: Samer Afach Date: Tue, 27 Mar 2018 23:01:45 +0200 Subject: [PATCH] Changed file encoding to UTF-8 --- SamAuthenticator/Authenticator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SamAuthenticator/Authenticator.py b/SamAuthenticator/Authenticator.py index e543ba3..a9bf676 100644 --- a/SamAuthenticator/Authenticator.py +++ b/SamAuthenticator/Authenticator.py @@ -31,7 +31,7 @@ def write_keys_to_file(auth_keys, password, file_name="data.dat"): if os.path.exists(file_name): os.rename(file_name, backup_file) with open(file_name, 'wb') as f: - f.write(encrypt_data(auth_keys.dump_data().encode(), password, _salt)) + f.write(encrypt_data(auth_keys.dump_data().encode('utf-8'), password, _salt)) if os.path.exists(backup_file): os.remove(backup_file) @@ -41,7 +41,7 @@ def read_keys_from_file(password, file_name="data.dat"): ciphered_data = f.read() readable_data = decrypt_data(ciphered_data, password, _salt) keys_object = AuthenticatorKeys() - keys_object.read_dump(readable_data.decode()) + keys_object.read_dump(readable_data.decode('utf-8')) return keys_object