diff options
author | mjfernez <mjfernez@gmail.com> | 2021-06-09 18:56:20 -0400 |
---|---|---|
committer | mjfernez <mjfernez@gmail.com> | 2021-06-09 18:56:47 -0400 |
commit | e9d152560dcd807fa76390942a0e38b362e0ec89 (patch) | |
tree | c160460850ceb57433eb1863b7353fcd0d9ae1fa /server.py | |
parent | e6da718cae160800832d0df7e8d81610ba376e3d (diff) | |
download | ezcms-e9d152560dcd807fa76390942a0e38b362e0ec89.tar.gz |
Force UTF-8 encoding
Diffstat (limited to 'server.py')
-rw-r--r-- | server.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |