Skip to content

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

@jeaneigsi

Description

@jeaneigsi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions