Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jacovanderlaan opened this issue Mar 6, 2023 · 4 comments

Comments

@jacovanderlaan
Copy link

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
Copy link

giftcp commented Mar 13, 2023

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
Copy link

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

@Ciges
Copy link

Ciges commented Feb 17, 2025

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

Thanks a lot, it works!

@Ciges
Copy link

Ciges commented Feb 19, 2025

Hello again,

I have forked the repository and made two modifications, getting the work begun by @giftcp :

  • Modifications on how to open Obsidian notes to avoid UnicodeDecodeError and to recognize correctly the end of line
  • Regular expressions are searched an replaced with MULTILINE flag on (^ matches the beginning of each line)

My fork is at https://github.com/Ciges/py-obsidianmd

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants