I am currently packaging a PyQt application on Windows using PyInstaller. Given the important size of the generated directory (86 Mbytes), I am trying to punch as much as possible from the generated directory.
One area where I suspect I am embarking too much is the encoding module. My application is pretty straightforward in terms of encoding usage :
- I use a Qt filesystem dialog to get the name of the file to open
- I use python open/read/write to read and write my data files. They are composed exclusively of ascii data but I’ll probably open it as UTF8 to be on the safe side
- it is possible to pass the name of the file to open on the command-line
- the application is window based but in debug mode, I package it in console mode and print on the stdout.
My understanding is that I need the following encodings :
- UTF8 for my file reading / writing
- Qt string to Python string uses probably internal Python mechanism, not sur about that
- file system encoding : if I read the documentation correctly, I only need mbcs and utf8 here. But is that really working on a Japanese user using japanese file names
The one where I am not clear are :
- command-line, what encoding is used here ?
- stdout, it uses the default codepage from what I understand, meaning that this is totally out of my control . But that’s only for debug purpose so I can perfectly skip that one.
So, can I limit myself to mbcs, utf8 and ascii ? My application works fine on my computer if I do this but that’s hardly a sign that it would work everywhere…