Use UTF-8 to store VCards

If we dont specify the encoding, the system default is used which leads to encoding/decoding errors, depending on what the actual system default encoding is.
This commit is contained in:
lovetox 2016-09-30 17:03:30 +02:00
parent d0ace18434
commit b7932e15ea
1 changed files with 2 additions and 2 deletions

View File

@ -332,7 +332,7 @@ class ConnectionVcard:
else:
path_to_file = path
try:
fil = open(path_to_file, 'w')
fil = open(path_to_file, 'w', encoding='utf-8')
fil.write(str(card))
fil.close()
except IOError as e:
@ -355,7 +355,7 @@ class ConnectionVcard:
if not os.path.isfile(path_to_file):
return None
# We have the vcard cached
f = open(path_to_file)
f = open(path_to_file, encoding='utf-8')
c = f.read()
f.close()
try: