diff --git a/gestion/affich_tools.py b/gestion/affich_tools.py index 6133ab24..cf111474 100755 --- a/gestion/affich_tools.py +++ b/gestion/affich_tools.py @@ -105,14 +105,14 @@ ERREUR = coul('ERREUR', 'rouge') def to_encoding(txt, enc=encoding): if type(txt) == unicode: - return txt.encode(enc) + return txt.encode(enc, 'ignore') else: # On suppose d'abord que le texte est en UTF-8 try: - return txt.decode("UTF-8").encode(enc) + return txt.decode("UTF-8").encode(enc, 'ignore') except: # Sinon c'est surement de l'iso - return txt.decode("ISO8859-15").encode(enc) + return txt.decode("ISO8859-15").encode(enc, 'ignore') def cprint(txt, col='blanc', newline=True): t = coul(to_encoding(txt), col)