Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2004-08-06 07:31:31
Size: 826
Editor: p508A85EA
Comment:
Revision 3 as of 2004-10-12 12:05:31
Size: 826
Editor: www
Comment:
No differences found!

= even more encoding=

Description

Some (at least me :) are working with a different default-encoding than "ASCII". I am using Latin-1, which solves 98% of encoding problems when dealing with Windows-Applications on a German Windows.

so in site.py I changed from ASCII to LATIN-1

Problem

When an application is py2exed, site.py is not available and not parsed. (and that is good)

So the behaviour of the py2exed and the python filename.py use of the application is quite different.

Solution

Top of the application I start with

   1 import sys
   2 if hasattr(sys,"setdefaultencoding"):
   3     sys.setdefaultencoding("latin-1")

Explanation

if site.py is run, it kills the "setdefaultencoding" attribute.

HAM20040806 - we need a ternary decorator

EvenMoreEncodings (last edited 2008-07-08 11:27:43 by localhost)