Closed A1r0x closed 1 month ago
When running the markdown file reader script on Windows, I encounter the following error while reading the sample.md markdown file:
'charmap' codec can't decode byte 0x90 in position 727: character maps to <undefined>
Python mdtoc sample.md <dest_file>
The file should be read without raising an encoding-related error.
explicitly set the encoding to utf-8 when reading the file: data = Path(file_name).read_text(encoding='utf-8')
data = Path(file_name).read_text(encoding='utf-8')
Description
When running the markdown file reader script on Windows, I encounter the following error while reading the sample.md markdown file:
'charmap' codec can't decode byte 0x90 in position 727: character maps to <undefined>
Steps to Reproduce:
Python mdtoc sample.md <dest_file>
Expected behavior
The file should be read without raising an encoding-related error.
Suggested fix
explicitly set the encoding to utf-8 when reading the file:
data = Path(file_name).read_text(encoding='utf-8')