Create process with wide chars on Windows

Windows does not support UTF-8, so pushing a file with non-ASCII
characters failed.

Convert the UTF-8 command line to a wide characters string and call
CreateProcessW().

Fixes <https://github.com/Genymobile/scrcpy/issues/422>
This commit is contained in:
Romain Vimont
2019-02-10 12:53:03 +01:00
parent c0b65b14df
commit 477c0a2cab
3 changed files with 40 additions and 2 deletions

View File

@@ -20,4 +20,10 @@ size_t xstrjoin(char *dst, const char *const tokens[], char sep, size_t n);
// returns the new allocated string, to be freed by the caller
char *strquote(const char *src);
#ifdef _WIN32
// convert a UTF-8 string to a wchar_t string
// returns the new allocated string, to be freed by the caller
wchar_t *utf8_to_wide_char(const char *utf8);
#endif
#endif