Comment 9 for bug 1666829

Revision history for this message
RJVB (rjvbertin) wrote :

As I thought, this is a locale issue; I'm getting

11:56:38: INFO - qarte Locale encoding: (None, None)

QLocale.system().name() returns 'en_GB' for me but for the rest I'm indeed running the default C locale.

This just underlines what I argued earlier: you cannot be certain of the locale and default encoding the user is using. Even if it were good practice to oblige the user to call Qarte with tweaked LC env. variables you still cannot assume that this will work the same way on all platforms.
Which takes me back to my position that with a locale.setpreferredencoding() function the only proper solution is to make sure the proper encoding is used for each of the concerned operations. Esp. when that requires such a minimal change.

Or maybe `locale.setlocale(locale.LC_ALL, (QLocale.system().name(), "utf-8"))` would do the trick, executed at the right place?