PLCControler.py
branchpython3
changeset 3755 ca814b175391
parent 3752 9f6f46dbe3ae
--- a/PLCControler.py	Fri Oct 28 14:26:17 2022 +0800
+++ b/PLCControler.py	Fri Oct 28 14:53:23 2022 +0800
@@ -454,8 +454,8 @@
                 self.NextCompiledProject = self.Copy(self.Project)
                 program_text = "".join([item[0] for item in self.ProgramChunks])
                 if filepath is not None:
-                    programfile = open(filepath, "w")
-                    programfile.write(program_text.encode("utf-8"))
+                    programfile = open(filepath, "w", encoding='utf-8')
+                    programfile.write(program_text)
                     programfile.close()
                     self.ProgramFilePath = filepath
                 return program_text, errors, warnings