McMillan / Tk / encoding problem

Gordon McMillan gmcm at hypernet.com
Sun Oct 6 13:37:39 CEST 2002


Thomas Korb wrote:

> Actually, I have the usual
> 
>   import sys
>   sys.setdefaultencoding('iso-8859-1')
> 
> in my sitecustomize.py. I don't know, how the default-encoding can be
> set otherwise. In my script, I use an explicit 'import sitecustomize',
> which is maybe very naive, but somehow worked. (Before that, I got
> errors when a character was not in the ASCII-range 0-127; after that,
> those errors did not show up anymore; so it seemed to have 'some'
> effect.) 
> 
> Is there another way to set the default-encoding for use with your
> installer? (I never liked sitecustomize.py any way; and I always felt
> that something like sys.setdefaultencoding(...) should work in a normal
> script, too.)  

When you live in the US, use a US keyboard and speak US English,
there is nothing usual about encodings at all. I managed to learn
that most of the world needs the encodings, so unless you use the
--ascii switch, Installer will pretend you imported them (all of
them). If Installer needs to do more to trigger Python's automagical
unicode support, someone will have to tell me what it is. 

-- Gordon
http://www.mcmillan-inc.com/





More information about the Python-list mailing list