Skip to content

Commit

Permalink
Merge pull request 20tab#623 from slartibaartfast/iss602
Browse files Browse the repository at this point in the history
Added TCHAR_TO_WCHAR to fix issue 602
  • Loading branch information
rdeioris authored Dec 12, 2018
2 parents 81b67e4 + ae7fd91 commit 7b89d52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/UnrealEnginePython/Private/PyCommandlet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int32 UPyCommandlet::Main(const FString& CommandLine)
#if PY_MAJOR_VERSION >= 3
argv[i] = (wchar_t*)malloc(PyArgv[i].Len() + 1);
#if PLATFORM_MAC || PLATFORM_LINUX
wcsncpy(argv[i], *PyArgv[i].ReplaceEscapedCharWithChar(), PyArgv[i].Len() + 1);
wcsncpy(argv[i], (const wchar_t *) TCHAR_TO_WCHAR(*PyArgv[i].ReplaceEscapedCharWithChar()), PyArgv[i].Len() + 1);
#elif PLATFORM_ANDROID
wcsncpy(argv[i], (const wchar_t *)*PyArgv[i].ReplaceEscapedCharWithChar(), PyArgv[i].Len() + 1);
#else
Expand Down
2 changes: 1 addition & 1 deletion Source/UnrealEnginePython/Private/UnrealEnginePython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void FUnrealEnginePythonModule::UESetupPythonInterpreter(bool verbose)
for (int32 i = 0; i < Args.Num(); i++)
{
#if PY_MAJOR_VERSION >= 3
argv[i] = (wchar_t *)(*Args[i]);
argv[i] = (wchar_t *)(TCHAR_TO_WCHAR(*Args[i]));
#else
argv[i] = TCHAR_TO_UTF8(*Args[i]);
#endif
Expand Down

0 comments on commit 7b89d52

Please sign in to comment.