mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-28 02:20:04 +01:00
Merge branch 'fix-windows-spawn-non-english' into 'main'
spawn-test: Fix running on non-English Windows See merge request GNOME/glib!3288
This commit is contained in:
commit
bd2ccc2f69
@ -76,9 +76,11 @@ test_spawn_basics (void)
|
|||||||
gchar *system_directory;
|
gchar *system_directory;
|
||||||
gchar spawn_binary[1000] = {0};
|
gchar spawn_binary[1000] = {0};
|
||||||
gchar full_cmdline[1000] = {0};
|
gchar full_cmdline[1000] = {0};
|
||||||
#endif
|
const LCID old_lcid = GetThreadUILanguage ();
|
||||||
|
const unsigned int initial_cp = GetConsoleOutputCP ();
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
SetConsoleOutputCP (437); /* 437 means en-US codepage */
|
||||||
|
SetThreadUILanguage (MAKELCID (MAKELANGID (LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT));
|
||||||
system_directory = get_system_directory ();
|
system_directory = get_system_directory ();
|
||||||
|
|
||||||
g_snprintf (spawn_binary, sizeof (spawn_binary),
|
g_snprintf (spawn_binary, sizeof (spawn_binary),
|
||||||
@ -254,6 +256,8 @@ test_spawn_basics (void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
|
SetThreadUILanguage (old_lcid);
|
||||||
|
SetConsoleOutputCP (initial_cp); /* 437 means en-US codepage */
|
||||||
g_free (system_directory);
|
g_free (system_directory);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user