BasilPH / vizel

Zettelkasten visualization and stats🤩🗒
GNU General Public License v3.0
59 stars 5 forks source link

Catch unicode decoding errors #24

Closed BasilPH closed 4 years ago

BasilPH commented 4 years ago

Throwing a UnicodeDecodeError when reading a Zettel shouldn't make the program crash.

BasilPH commented 4 years ago

From reading "Processing Text Files in Python 3", I learned that we could use the surrogateescape error handler to hide decoding problems.

However, since I don't completely understand where those UnicodeDecodeErrors come from on Windows, I'll probably opt for just catching UnicodeDecodeError, printing a warning, and skipping the file.