For OSX, you can set the encoding by placing the following as the first or
second line of a module:
#-*- coding: utf-8 -*-
That doesn't work on Windows, as Python apparently sets the encoding when
starting up and won't change it later.
It appears that the proper way is to is to create a module called
sitecustomize.py in PYTHONPATH that contains:
import sys
sys.setdefaultencoding('utf-8')
Or to edit site.py to set the default encoding. Either of these methods has
the drawback that it affects all Python processes.
As a practical matter, this seems to work if placed so it executes at the
beginning of a script:
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
Does this sound correct?
WRT pyinstaller, what is the best way to handle this?
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.