aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authormjfernez <mjfernez@gmail.com>2021-06-09 18:56:20 -0400
committermjfernez <mjfernez@gmail.com>2021-06-09 18:56:47 -0400
commite9d152560dcd807fa76390942a0e38b362e0ec89 (patch)
treec160460850ceb57433eb1863b7353fcd0d9ae1fa /server.py
parente6da718cae160800832d0df7e8d81610ba376e3d (diff)
downloadezcms-e9d152560dcd807fa76390942a0e38b362e0ec89.tar.gz
Force UTF-8 encoding
Diffstat (limited to 'server.py')
-rw-r--r--server.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/server.py b/server.py
index 692fe8c..e2e93f0 100644
--- a/server.py
+++ b/server.py
@@ -119,8 +119,8 @@ def render_file(path):
)
if os.path.isfile(abs_path):
if abs_path.endswith('.html'):
- with open(abs_path) as f:
- content = f.read()
+ with open(abs_path, 'rb') as f:
+ content = f.read().decode("UTF-8")
return render_template_string(CONTENT_BLOCK.replace('$', content), **context)
elif abs_path.endswith('.html!'):
return render_template("site/" + path, **context)