From: Renaud Barate Date: Fri, 20 May 2011 08:35:40 +0000 (+0000) Subject: Fix encoding bug in CR X-Git-Tag: LOGILAB~318 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a4d41fbceb2077791d6bfb048a88657377e042f;p=tools%2Feficas.git Fix encoding bug in CR --- diff --git a/Noyau/N_CR.py b/Noyau/N_CR.py index 37f3eb3f..cb1d7a26 100644 --- a/Noyau/N_CR.py +++ b/Noyau/N_CR.py @@ -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 :