Fixed encoding problem when using blog plugin (#6103)

This commit is contained in:
Alexander Voss
2023-09-29 15:26:32 +02:00
committed by GitHub
parent cef79862a2
commit 1be39328ac
2 changed files with 2 additions and 2 deletions

View File

@@ -861,7 +861,7 @@ class BlogPlugin(BasePlugin[BlogConfig]):
# 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)
# -------------------------------------------------------------------------

View File

@@ -861,7 +861,7 @@ class BlogPlugin(BasePlugin[BlogConfig]):
# 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)
# -------------------------------------------------------------------------