python3 - the hardest hello world ever ?

Helmut Jarausch jarausch at
Thu Oct 16 11:28:13 CEST 2008

Martin v. Löwis wrote:
>> Still, I wished it were possible call sys.setdefaultencoding
>> at the very beginning of a script.
>> Why isn't that possible?
> The default encoding was used when combining byte-oriented
> text and unicode-oriented text. Such combination is no longer
> supported, hence the notion of a default encoding
> has disappeared. You have to perform conversion between bytes
> and strings now explicitly.

I meant setting the default encoding which is used by print (e.g.) when
outputting the internal unicode string to a file.
As far as I understood, currently I am fixed to setting either
the 'locale' or to switch settings for each output file (by settting
the _encoding property.
I wished I could override the locale settings within a Python script.


Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

More information about the Python-list mailing list