CodeMouse92 / Timecard

Track time beautifully.
https://codemouse92.github.io/Timecard/
BSD 3-Clause "New" or "Revised" License
31 stars 7 forks source link

Added file encoding handling #17

Closed jwigert closed 4 years ago

jwigert commented 4 years ago

Hi,

I encountered the following error when trying to run the project:

File "C:\Users\xyz\AppData\Local\Programs\Python\Python38\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 0x9d in position 2686: character maps to <undefined>

I'm running a Swedish installation of Windows 10, and this seems to be related to the file encoding in my system. I resolved it by adding utf-8 encoding to the file open statements. I've never done anything in python previously, so please let me know if this was not the correct solution.

Kind regards, Johan