Skip to content

Commit

Permalink
Fixed encoding problem when using blog plugin (#6103)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvoss authored Sep 29, 2023
1 parent cef7986 commit 1be3932
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion material/plugins/blog/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ def _path_to_file(self, path: str, config: MkDocsConfig, *, temp = True):
# Create a file with the given content on disk
def _save_to_file(self, path: str, content: str):
os.makedirs(os.path.dirname(path), exist_ok = True)
with open(path, "w") as f:
with open(path, "w", encoding = "utf-8") as f:
f.write(content)

# -------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/blog/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ def _path_to_file(self, path: str, config: MkDocsConfig, *, temp = True):
# Create a file with the given content on disk
def _save_to_file(self, path: str, content: str):
os.makedirs(os.path.dirname(path), exist_ok = True)
with open(path, "w") as f:
with open(path, "w", encoding = "utf-8") as f:
f.write(content)

# -------------------------------------------------------------------------
Expand Down

0 comments on commit 1be3932

Please sign in to comment.