mondeja / mkdocs-mdpo-plugin

Mkdocs translation plugin using PO files.
https://mondeja.github.io/mkdocs-mdpo-plugin/
BSD 3-Clause "New" or "Revised" License
7 stars 5 forks source link

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 57: invalid continuation byte #26

Closed ucoruh closed 2 years ago

ucoruh commented 2 years ago

ERROR - Encoding error reading file: en\licence\index.md ERROR - Error reading page 'en\licence\index.md': 'utf-8' codec can't decode byte 0xf0 in position 57: invalid continuation byte ERROR - Error reading page 'licence.md': 'utf-8' codec can't decode byte 0xf0 in position 57: invalid continuation byte Traceback (most recent call last): File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Program Files\Python310\Scripts\mkdocs.exe__main.py", line 7, in File "C:\Program Files\Python310\lib\site-packages\click\core.py", line 1128, in call return self.main(*args, kwargs) File "C:\Program Files\Python310\lib\site-packages\click\core.py", line 1053, in main rv = self.invoke(ctx) File "C:\Program Files\Python310\lib\site-packages\click\core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Program Files\Python310\lib\site-packages\click\core.py", line 1395, in invoke return ctx.invoke(self.callback, ctx.params) File "C:\Program Files\Python310\lib\site-packages\click\core.py", line 754, in invoke return callback(*args, kwargs) File "C:\Program Files\Python310\lib\site-packages\mkdocs__main__.py", line 177, in serve_command serve.serve(dev_addr=dev_addr, livereload=livereload, kwargs) File "C:\Program Files\Python310\lib\site-packages\mkdocs\commands\serve.py", line 54, in serve config = builder() File "C:\Program Files\Python310\lib\site-packages\mkdocs\commands\serve.py", line 49, in builder build(config, live_server=live_server, dirty=dirty) File "C:\Program Files\Python310\lib\site-packages\mkdocs\commands\build.py", line 292, in build _populate_page(file.page, config, files, dirty) File "C:\Program Files\Python310\lib\site-packages\mkdocs\commands\build.py", line 170, in _populate_page page.markdown = config['plugins'].run_event( File "C:\Program Files\Python310\lib\site-packages\mkdocs\plugins.py", line 102, in run_event result = method(item, **kwargs) File "C:\Program Files\Python310\lib\site-packages\mkdocs_mdpo_plugin\plugin.py", line 359, in on_page_markdown mkdocs.commands.build._populate_page( File "C:\Program Files\Python310\lib\site-packages\mkdocs\commands\build.py", line 167, in _populate_page page.read_source(config) File "C:\Program Files\Python310\lib\site-packages\mkdocs\structure\pages.py", line 120, in read_source source = f.read() File "C:\Program Files\Python310\lib\codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) File "C:\Program Files\Python310\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 0xf0 in position 57: invalid continuation byte

mondeja commented 2 years ago

Seems a problem with Mkdocs in this line, but maybe not, I'm not sure without more info about it. Could you check if the error happens without the plugin installed? Also, I need:

ucoruh commented 2 years ago

I think the faster solution is to share the repository with you. If you can enable the plugin for the following repository (these are my course notes) then you can also debug on your site easily. Thanks for your work.

https://github.com/ucoruh/ce100-algorithms-and-programming-II

mondeja commented 2 years ago

Sorry, but I'm not going to do your work. In fact, I don't understand the repository that you've provided and I will not waste my time studying it. If you are interested in resolving the issue share the data that has been requested.