- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Blog category accent problem #6069
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
Comments
Thanks for reporting and providing the minimal reproduction. Unfortunately, I'm not able to observe the error – I'm on macOS and you're using Windows. It looks like you did not save your file in UTF-8, but in some other encoding. Could you please check if this also happens if you create a file with the same name, not using the blog plugin? In that case, this error ir not exclusively related to the blog plugin, but to MkDocs itself. Here's what I get – a perfectly working site: |
Ok, I had to change to the public version of mkdocs-material because my Windows laptop is not fully set up but with that I was able to reproduce the issue. One thing I just realized is that the file that cannot be read is not the original file containing the blog post but |
Thanks for the confirmation! I'll be back as soon as I'm done updating my VMs. |
I wasn't able to reproduce this with generated files as well. It's likely a problem that only occurs on Windows, so if you can have a look at it @alexvoss, that would be great. As suggested in my last comment, try the following:
We need to know what causes this, and if we must fix it or MkDocs. |
Right, made the offending blog post a normal page and the site builds fine. Also changed the text to something with German ÄÖÜ and this causes a different error:
I will see that I set up a development environment on Windows so I can have a look. |
Perfect, thanks for looking into it! Did you use UTF-8 as a file encoding? |
The original file was utf-8 encoded (had a look with a hex editor) and I assume |
Thanks, this is very useful. I am able to reproduce the problem and am setting up a development environment on a Windows box to try and debug. Might be tomorrow before I can really have a look at this, though. |
Ok, thank you! |
I think I know where this might be coming from: I think we're missing the Encoding here: mkdocs-material/src/plugins/blog/plugin.py Line 864 in 305c336
Could you try changing to one of the following, and check if the error is gone? with open(path, "w" encoding = "utf-8") as f: with open(path, "w" encoding = "utf-8-sig") as f: |
Yes, that does fix the problem for me. Well spotted! Sorry, I used the second line, also added in a comma before |
Ok, sorry, that took longer than I would have liked it to but I can report that |
@alexvoss great! Could you create a PR that adds the encoding to the call? We're going for |
@squidfunk am on it but am running into issues setting up the development environment on Windows, so may take a little longer. I do not want to just edit the file and assume that this fixes it, so need to do this on my favorite game launcher ;o) |
No hurry |
On that note. I got to the point where I needed to install |
I've had success with VirtualBox and one of those free IE Testing machines from Microsoft a while ago, but don't really know what the current situation is. I'm also desperately in need of a Windows env, but I also don't want to carry around two laptops all the time. Meh meh meh. |
@alexvoss would you like to create a PR for this or should I go ahead and fix it? |
@squidfunk will do a pull request. |
Released as part of 9.4.3. |
Context
Something has changed, it was still working 1-2 months ago. I installed the latest version.
Bug description
If the category name contains an accented character, then:
Related links
categories
Reproduction
9.4.1+insiders.4.42.0-accent.zip
Steps to reproduce
Just uncomment
#- Általános
insample-post-1.md
file.and
mkdocs serve
.Browser
Chrome
Before submitting
The text was updated successfully, but these errors were encountered: