Linux: Ensure that the python embedded in the kitty binary build always uses UTF-8 mode

Fixes #924
This commit is contained in:
Kovid Goyal 2018-09-08 23:03:36 +05:30
parent e39635ea16
commit 9963e78636
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 0 deletions

View File

@ -12,6 +12,9 @@ Changelog
- Add a new ``neighboring_window`` function to switch to neighboring - Add a new ``neighboring_window`` function to switch to neighboring
windows in the current layout, similar to window movement in vim (:iss:`916`) windows in the current layout, similar to window movement in vim (:iss:`916`)
- Linux: Ensure that the python embedded in the kitty binary build always uses
UTF-8 mode (:iss:`924`)
0.12.1 [2018-09-08] 0.12.1 [2018-09-08]
------------------------------ ------------------------------

View File

@ -153,6 +153,10 @@ int main(int argc, char *argv[]) {
final_argv[i+1] = argv[i]; final_argv[i+1] = argv[i];
num_args++; num_args++;
} }
#if PY_VERSION_HEX >= 0x03070000
// Always use UTF-8 mode, see https://github.com/kovidgoyal/kitty/issues/924
Py_UTF8Mode = 1;
#endif
for (i = 0; i < num_args; i++) { for (i = 0; i < num_args; i++) {
argvw[i] = Py_DecodeLocale(final_argv[i], NULL); argvw[i] = Py_DecodeLocale(final_argv[i], NULL);
if (argvw[i] == NULL) { if (argvw[i] == NULL) {