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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 # Create a file with the given content on disk
def _save_to_file(self, path: str, content: str): def _save_to_file(self, path: str, content: str):
os.makedirs(os.path.dirname(path), exist_ok = True) 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) f.write(content)
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------

View File

@ -861,7 +861,7 @@ class BlogPlugin(BasePlugin[BlogConfig]):
# Create a file with the given content on disk # Create a file with the given content on disk
def _save_to_file(self, path: str, content: str): def _save_to_file(self, path: str, content: str):
os.makedirs(os.path.dirname(path), exist_ok = True) 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) f.write(content)
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------