UTF-8 in logs causes crash
If you are using UTF-8 chars in your logs, there is a crash:
Traceback (most recent call last):
File "C:/svn/PycharmProjects/QRZ-Lookup/lookup.py", line 24, in <module>
qsos_raw, adif_header = adif_io.read_from_file("log.adi")
File "C:\svn\PycharmProjects\QRZ-Lookup\venv\venv\lib\site-packages\adif_io\__init__.py", line 93, in read_from_file
adif_string = adif_file.read()
File "C:\Users\xxx\Documents\Python3.8\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 291930: character maps to <undefined>
This can be fixed with a small change to init.py at line 92 to open the file with UTF-8 support:
def read_from_file(filename):
with open(filename, encoding="utf-8") as adif_file:
adif_string = adif_file.read()
return read_from_string(adif_string)
Edited by Gerry Magill