proper way to handle this (console output has totally different encoding than the page one)

This commit is contained in:
Miroslav Stampar 2011-01-17 10:27:36 +00:00
parent 34d13be0d3
commit ac0b5e6dbc

View File

@ -425,7 +425,7 @@ def dataToStdout(data, forceOutput=False):
try:
sys.stdout.write(data)
except UnicodeEncodeError:
sys.stdout.write(data.encode(kb.pageEncoding or conf.dataEncoding))
sys.stdout.write(data.encode(conf.dataEncoding))
finally:
sys.stdout.flush()