[Idle-dev] Re: [Tutor] IDLE has problem with Umlaute

Hernan Martinez Foffani hernan@orgmf.com.ar
Mon, 6 May 2002 20:19:05 +0200


See FAQ 4.102 at
http://www.python.org/cgi-bin/faqw.py?req=show&file=faq04.102.htp

Basically you just create a file sitecustomize.py under
site-packages directory with the following content:
    # Set the string encoding used by the Unicode implementation.
    # The default is 'ascii'
    encoding = "ascii" # <= CHANGE THIS if you wish

    # Enable to support locale aware default string encodings.
    import locale
    loc = locale.getdefaultlocale()
    if loc[1]:
        encoding = loc[1]
    if encoding != "ascii":
        import sys
        sys.setdefaultencoding(encoding)

Beware that if you do that the python programs you write may
not be portable between sites with different encodings!!!!!!!!

Regards,
-Hernan