Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Default to utf-8 when reading files in :class:`.Code` (#2703)

Lingren Kongfcb76ee64a6f
diff --git a/manim/mobject/text/code_mobject.py b/manim/mobject/text/code_mobject.py
index 0d5e7cb23..5a710396f 100644
--- a/manim/mobject/text/code_mobject.py
+++ b/manim/mobject/text/code_mobject.py
@@ -199,7 +199,7 @@ class Code(VGroup):
self.file_name = file_name
if self.file_name:
self._ensure_valid_file()
- with open(self.file_path) as f:
+ with open(self.file_path, encoding="utf-8") as f:
self.code_string = f.read()
elif code:
self.code_string = code