From 1be39328acdd889ef6623f267e687a45e4782a93 Mon Sep 17 00:00:00 2001 From: Alexander Voss Date: Fri, 29 Sep 2023 15:26:32 +0200 Subject: [PATCH] Fixed encoding problem when using blog plugin (#6103) --- material/plugins/blog/plugin.py | 2 +- src/plugins/blog/plugin.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/material/plugins/blog/plugin.py b/material/plugins/blog/plugin.py index ef343100b..375b8cfe7 100644 --- a/material/plugins/blog/plugin.py +++ b/material/plugins/blog/plugin.py @@ -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) # ------------------------------------------------------------------------- diff --git a/src/plugins/blog/plugin.py b/src/plugins/blog/plugin.py index ef343100b..375b8cfe7 100644 --- a/src/plugins/blog/plugin.py +++ b/src/plugins/blog/plugin.py @@ -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) # -------------------------------------------------------------------------