Sous OpenBSD, l'encodage est None en l'absence de terminal
darcs-hash:20060414151452-d1718-0d53d5a7bb34c9c55a3daee3872b2bd0170d6f18.gz
This commit is contained in:
parent
1bc7473b7e
commit
7ff8d38c72
1 changed files with 4 additions and 0 deletions
|
@ -10,10 +10,14 @@ Licence : GPLv2
|
|||
import sys, sre, os, tempfile
|
||||
|
||||
# Détermination de l'encodage
|
||||
encoding = None
|
||||
try:
|
||||
from locale import getpreferredencoding
|
||||
encoding = getpreferredencoding()
|
||||
except:
|
||||
pass
|
||||
|
||||
if not encoding:
|
||||
encoding = sys.stdin.encoding or "ISO-8859-15"
|
||||
|
||||
# Si aucune locale n'est définie, on se met en ISO-8859-15
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue