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

UnicodeEncodeError : 'charmap' codec can't encode characters in position 2473-2474: character maps to #7

Open
jeaneigsi opened this issue May 6, 2024 · 1 comment

Comments

@jeaneigsi
Copy link

jeaneigsi commented May 6, 2024

The error occurs in the crawl function in the init.py file, specifically in the section where markdown content is written to a file. Here is the relevant code excerpt:

# line 140 
with open(file_path, 'w') as f:
    f.write(output)

To resolve this issue, I suggest specifying the encoding when opening the file for writing. Here is the corrected code:

with open(file_path, 'w', encoding='utf-8') as f:
    f.write(output)

By adding encoding='utf-8' to the open() function, Python will use UTF-8 encoding when writing the file, which should prevent the UnicodeEncodeError.

@pvbang
Copy link

pvbang commented Jun 8, 2024

nice bro, same problem :)))

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

2 participants