Fixing bug when building textual code containing comment with special characters
authorlaurent
Mon, 09 Jan 2012 11:08:08 +0100
changeset 622 05394e275a1c
parent 621 084a21799803
child 623 e747685e4241
Fixing bug when building textual code containing comment with special characters
PLCControler.py
--- a/PLCControler.py	Sun Jan 08 19:33:26 2012 +0100
+++ b/PLCControler.py	Mon Jan 09 11:08:08 2012 +0100
@@ -533,10 +533,10 @@
             try:
                 self.ProgramChunks = GenerateCurrentProgram(self, self.Project, errors, warnings)
                 self.NextCompiledProject = self.Copy(self.Project)
-                program_text = "".join([item[0] for item in self.ProgramChunks])
+                program_text = "".join([item[0].decode("utf-8") for item in self.ProgramChunks])
                 if filepath is not None:
                     programfile = open(filepath, "w")
-                    programfile.write(program_text)
+                    programfile.write(program_text.encode("utf-8"))
                     programfile.close()
                     self.ProgramFilePath = filepath
                 return program_text, errors, warnings