mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-14 19:55:12 +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 spawn_binary[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 ();
|
||||
|
||||
g_snprintf (spawn_binary, sizeof (spawn_binary),
|
||||
@ -254,6 +256,8 @@ test_spawn_basics (void)
|
||||
#endif
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
SetThreadUILanguage (old_lcid);
|
||||
SetConsoleOutputCP (initial_cp); /* 437 means en-US codepage */
|
||||
g_free (system_directory);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user