diff --git c/src/process.c i/src/process.c index e7ee99a..2c17b5a 100644 --- c/src/process.c +++ i/src/process.c @@ -1881,8 +1881,7 @@ usage: (make-process &rest ARGS) */) if (STRING_MULTIBYTE (arg)) { if (NILP (arg_encoding)) - arg_encoding = (complement_process_encoding_system - (XPROCESS (proc)->encode_coding_system)); + arg_encoding = Qutf_8; arg = code_convert_string_norecord (arg, arg_encoding, 1); } tem = Fcons (arg, tem); diff --git c/src/w32proc.c i/src/w32proc.c index 76af55f..86aaee2 100644 --- c/src/w32proc.c +++ i/src/w32proc.c @@ -1204,14 +1204,13 @@ static BOOL create_child (char *exe, char *cmdline, char *env, int is_gui_app, pid_t * pPid, child_process *cp) { - STARTUPINFO start; + STARTUPINFOW start; SECURITY_ATTRIBUTES sec_attrs; #if 0 SECURITY_DESCRIPTOR sec_desc; #endif DWORD flags; char dir[ MAX_PATH ]; - char *p; const char *ext; if (cp == NULL) emacs_abort (); @@ -1242,14 +1241,8 @@ create_child (char *exe, char *cmdline, char *env, int is_gui_app, sec_attrs.lpSecurityDescriptor = NULL /* &sec_desc */; sec_attrs.bInheritHandle = FALSE; - filename_to_ansi (process_dir, dir); - /* Can't use unixtodos_filename here, since that needs its file name - argument encoded in UTF-8. OTOH, process_dir, which _is_ in - UTF-8, points, to the directory computed by our caller, and we - don't want to modify that, either. */ - for (p = dir; *p; p = CharNextA (p)) - if (*p == '/') - *p = '\\'; + strcpy (dir, process_dir); + unixtodos_filename (dir); /* CreateProcess handles batch files as exe specially. This special handling fails when both the batch file and arguments are quoted. @@ -1265,8 +1258,13 @@ create_child (char *exe, char *cmdline, char *env, int is_gui_app, : CREATE_NEW_CONSOLE); if (NILP (Vw32_start_process_inherit_error_mode)) flags |= CREATE_DEFAULT_ERROR_MODE; - if (!CreateProcessA (exe, cmdline, &sec_attrs, NULL, TRUE, - flags, env, dir, &start, &cp->procinfo)) + + wchar_t exeW[MAX_PATH], cmdlineW[MAX_PATH], dirW[MAX_PATH]; + filename_to_utf16 (exe, exeW); + filename_to_utf16 (cmdline, cmdlineW); + filename_to_utf16 (dir, dirW); + if (!CreateProcessW (exeW, cmdlineW, &sec_attrs, NULL, TRUE, + flags, env, dirW, &start, &cp->procinfo)) goto EH_Fail; cp->pid = (int) cp->procinfo.dwProcessId;