When I run a script as is, and freezes it with cxFreze, I got encoding errors. After looking into it, the problem is that cxFreeze seems to go back to the 'ascii' encoding, although Python uses 'utf-8' as default.
Here's the simple script that I use:
import sys
print sys.getdefaultencoding()
Couldn't be shorter. The setup.py file:
import cx_Freeze
executables = [cx_Freeze.Executable("test_encoding.py")]
cx_Freeze.setup(
name = 'test encoding',
version = '0.1',
description = "Nothing much...",
executables = executables,
)
If I run it directly:
> python27 test_encoding.py
utf-8
But while frozen:
> build\exe.win32-2.7\test_encoding.exe
ascii
Does anyone know why it happens... and how to fix it? As you can imagine, that creates lots of errors, particularly with wxPython.
Version information:
- Python: 2.7 (32-bit)
- Operating system: Windows 10 (64-bit)
- cx_Freeze: 4.3.4