# HG changeset patch # User Markus Mützel # Date 1606669357 -3600 # Sun Nov 29 18:02:37 2020 +0100 # Node ID acabea37c361ba5c85367ffd2f51fc71cf333f39 # Parent e5b6c2f855190cef1cac5c8f5d0ce3b42b353e32 system: Support non-ASCII characters for asynchronous mode on Windows (bug #59572). * liboctave/wrappers/async-system-wrapper.cc (octave_async_system_wrapper): Use wide character API on Windows. diff -r e5b6c2f85519 -r acabea37c361 liboctave/wrappers/async-system-wrapper.c --- a/liboctave/wrappers/async-system-wrapper.c Sun Nov 29 14:20:08 2020 +0100 +++ b/liboctave/wrappers/async-system-wrapper.c Sun Nov 29 18:02:37 2020 +0100 @@ -43,6 +43,10 @@ #include "async-system-wrapper.h" +#if defined (OCTAVE_USE_WINDOWS_API) +# include "uniconv-wrappers.h" +#endif + pid_t octave_async_system_wrapper (const char *cmd) { @@ -53,17 +57,15 @@ #if defined (OCTAVE_USE_WINDOWS_API) - STARTUPINFO si; + STARTUPINFOW si; PROCESS_INFORMATION pi; ZeroMemory (&si, sizeof (si)); ZeroMemory (&pi, sizeof (pi)); - char *xcmd = (char *) malloc (strlen (cmd) + 1); + wchar_t *xcmd = u8_to_wchar (cmd); - strcpy (xcmd, cmd); - - if (! CreateProcess (0, xcmd, 0, 0, FALSE, 0, 0, 0, &si, &pi)) + if (! CreateProcessW (NULL, xcmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) retval = -1; else {