[scripts] Going to utf-8
This commit is contained in:
parent
c4a19a88ed
commit
a1bf0a4547
54 changed files with 676 additions and 573 deletions
|
@ -18,11 +18,11 @@ except:
|
|||
pass
|
||||
|
||||
if not encoding:
|
||||
encoding = sys.stdin.encoding or "ISO-8859-15"
|
||||
encoding = sys.stdin.encoding or 'UTF-8'
|
||||
|
||||
# Si aucune locale n'est définie, on se met en ISO-8859-15
|
||||
# Si aucune locale n'est définie, on se met en...
|
||||
if encoding == "ANSI_X3.4-1968":
|
||||
encoding = "ISO-8859-15"
|
||||
encoding = 'UTF-8'
|
||||
|
||||
if 'TERM' in os.environ and os.environ['TERM'] != 'unknown':
|
||||
el = subprocess.Popen('tput cr ; tput el', shell=True, stdout=subprocess.PIPE).stdout.read()
|
||||
|
@ -115,7 +115,7 @@ def to_unicode(txt, enc=encoding):
|
|||
return txt.decode("UTF-8")
|
||||
except:
|
||||
# Sinon c'est surement de l'iso
|
||||
return txt.decode("ISO8859-15")
|
||||
return txt.decode("UTF-8")
|
||||
|
||||
def to_encoding(txt, enc=encoding):
|
||||
return to_unicode(txt).encode(enc, 'ignore')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue