Skip to content

spawn-test: Fix running on non-English Windows

Chun-wei Fan requested to merge fix-windows-spawn-non-english into main

Hi,

The spawn-test test program fails when a non-English version of Windows is being used, as:

  • g_win32_error_message() returns error messages in the language version of the running system, but then the system is set to operate with a different non-Unicode locale in the system settings. -or-
  • The Unknown TAP output lines for a supported TAP version results as unicode conversion fails, particularly under CJK (Chinese, Japanese Korean, and possibly other language versions of) Windows.

This attempts to fix the test program running on such systems by momentarily forcing the console output codepage to 437 (English (United States), en-US in short), and forcing the thread UI locale to en-US as well, so that we are assured that everything is running in English regardless of the language version of Windows.

With blessings, thank you!

Merge request reports