[py2exe.i18n] English works, German works, but not French. What do I miss?

Harald Massa cpl.19.ghum at spamgourmet.com
Fri Aug 6 03:16:33 EDT 2004


"F. GEIGER" <f.geiger at vol.at> wrote in news:cev7g9$3fm$1 at newshispeed.ch:

> When I start a py2exe-ed application I get the error
> 
> 'ascii' codec can't encode character u'\xe9' in position 10: ordinal
> not in range(128)


encodings: prepare to spend the night.

First reading: 
http://starship.python.net/crew/theller/moin.cgi/EncodingsAgain

Second: 
your error msg says that you are trying to encode sth. NOT ASCII to 
ASCII...

I guess:
your lokale site has another encoding configured 


import sys
sys.getdefaultencoding()

-- returns sth. like Latin-1

And the py2exed application does not read siteconfig.py, and so in the 
running app sys.getdefaultencoding() would be some thing different.

My approach to this is:

in the beginning of the app I write:

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

so ... when no site-config was run, I manually set my default encoding to 
latin-1

works great (together with what I described within the wiki)

Harald



More information about the Python-list mailing list