improved handling of non-ascii characters in file names on windows

This commit is contained in:
Andrey Prygunkov
2013-10-23 19:22:02 +00:00
parent 33733af3c5
commit ae6601d9e3
5 changed files with 30 additions and 1 deletions

View File

@@ -423,7 +423,12 @@ int ScriptController::Execute()
char* szEnvironmentStrings = m_environmentStrings.GetStrings();
BOOL bOK = CreateProcess(NULL, szCmdLine, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW, szEnvironmentStrings, m_szWorkingDir, &StartupInfo, &ProcessInfo);
char szWorkingDir[260];
strncpy(szWorkingDir, m_szWorkingDir, 260);
szWorkingDir[260-1] = '\0';
Util::Utf8ToAnsi(szWorkingDir, strlen(m_szWorkingDir) + 1);
BOOL bOK = CreateProcess(NULL, szCmdLine, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW, szEnvironmentStrings, szWorkingDir, &StartupInfo, &ProcessInfo);
if (!bOK)
{
DWORD dwErrCode = GetLastError();