]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
Fix encoding bug in CR
authorRenaud Barate <renaud.barate@edf.fr>
Fri, 20 May 2011 08:35:40 +0000 (08:35 +0000)
committerRenaud Barate <renaud.barate@edf.fr>
Fri, 20 May 2011 08:35:40 +0000 (08:35 +0000)
Noyau/N_CR.py

index 37f3eb3f766c593ce2f9b6b7b00049a2aede6019..cb1d7a26e7ee4b610b8b0de8ab85f14f3c7a76a1 100644 (file)
@@ -136,6 +136,16 @@ class CR :
          else:
             if not subcr.estvide():
                s=s+str(subcr)
+
+      # convert all (eventually unicode) strings to 8-bit strings to
+      # avoid further encoding problems
+      if isinstance(self.debut, unicode):
+         self.debut = self.debut.encode("iso-8859-1")
+      if isinstance(s, unicode):
+         s = s.encode("iso-8859-1")
+      if isinstance(self.fin, unicode):
+         self.fin = self.fin.encode("iso-8859-1")
+
       if s != '':
          s=self.debut+'\n'+self.indent(s)+self.fin+'\n'
       else :