Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Made sure to always encode written TeX files as UTF-8

fwcdf48eb6d94ec9
diff --git a/manimlib/utils/tex_file_writing.py b/manimlib/utils/tex_file_writing.py
index 7bfcbf1be..1c296d294 100644
--- a/manimlib/utils/tex_file_writing.py
+++ b/manimlib/utils/tex_file_writing.py
@@ -1,5 +1,6 @@
import os
import hashlib
+import codecs
from manimlib.constants import TEX_DIR
from manimlib.constants import TEX_TEXT_TO_REPLACE
@@ -32,7 +33,7 @@ def generate_tex_file(expression, template_tex_file_body):
new_body = template_tex_file_body.replace(
TEX_TEXT_TO_REPLACE, expression
)
- with open(result, "w") as outfile:
+ with open(result, "w", encoding="utf-8") as outfile:
outfile.write(new_body)
return result