selimrbd / py-obsidianmd

Python interface to your Obsidian notes
BSD 3-Clause "New" or "Revised" License
273 stars 22 forks source link

UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 178: character maps to <undefined> #22

Open jacovanderlaan opened 1 year ago

jacovanderlaan commented 1 year ago

Hi there,

I am testing your code on a vault of imported Notion files. I get the error "UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 178: character maps to " because Notion puts icons in the file: 🏭 Parties: [[bunq]] 🗃️ Products (Prof): [[Anki]] I can manually remove these images but it would be nice if the code would ignore these characters.

Many thanks for the good work. It looks like this could help me a lot!

Regards,

Jaco

giftcp commented 1 year ago

I have forked the code with a potential fix of this problem. please check out my fork. I am not very familiar with github. I guess the proper approach would have been to create a new branch

philcombiths commented 10 months ago

I fixed this by editing the Note class init to import notes with encoding="utf-8"