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

mkdocs serve failed due to utf-8' codec can't decode byte 0x96 #299

Open
mrbarua opened this issue Jan 22, 2025 · 0 comments
Open

mkdocs serve failed due to utf-8' codec can't decode byte 0x96 #299

mrbarua opened this issue Jan 22, 2025 · 0 comments

Comments

@mrbarua
Copy link

mrbarua commented Jan 22, 2025

Convert .docx to .md file and later that file is added into mkdocs docs folder.
After:
mkdocs serve
I got the following errors:

ERROR   -  Encoding error reading file: 80566.md
ERROR   -  Error reading page '80566.md': 'utf-8' codec can't decode byte 0x96 in position 711: invalid start byte
Traceback (most recent call last):
  File "C:\Program Files\Python313\Lib\site-packages\mkdocs\livereload\__init__.py", line 211, in _build_loop
    self.builder()
    ~~~~~~~~~~~~^^
  File "C:\Program Files\Python313\Lib\site-packages\mkdocs\commands\serve.py", line 67, in builder
    build(config, serve_url=None if is_clean else serve_url, dirty=is_dirty)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python313\Lib\site-packages\mkdocs\commands\build.py", line 310, in build
    _populate_page(file.page, config, files, dirty)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python313\Lib\site-packages\mkdocs\commands\build.py", line 159, in _populate_page
    page.read_source(config)
    ~~~~~~~~~~~~~~~~^^^^^^^^
  File "C:\Program Files\Python313\Lib\site-packages\mkdocs\structure\pages.py", line 212, in read_source
    source = self.file.content_string
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python313\Lib\site-packages\mkdocs\structure\files.py", line 462, in content_string
    return f.read()
           ~~~~~~^^
  File "<frozen codecs>", line 325, in decode
  File "C:\Program Files\Python313\Lib\encodings\utf_8_sig.py", line 69, in _buffer_decode
    return codecs.utf_8_decode(input, errors, final)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 711: invalid start byte
ERROR   -  [08:17:18] An error happened during the rebuild. The server will appear stuck until build errors are resolved.
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

1 participant