diff --git a/Source/UnrealEnginePython/Private/PyCommandlet.cpp b/Source/UnrealEnginePython/Private/PyCommandlet.cpp index 9b22ae818..3a1643ae9 100644 --- a/Source/UnrealEnginePython/Private/PyCommandlet.cpp +++ b/Source/UnrealEnginePython/Private/PyCommandlet.cpp @@ -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 diff --git a/Source/UnrealEnginePython/Private/UnrealEnginePython.cpp b/Source/UnrealEnginePython/Private/UnrealEnginePython.cpp index a7e944dd2..5665e4746 100644 --- a/Source/UnrealEnginePython/Private/UnrealEnginePython.cpp +++ b/Source/UnrealEnginePython/Private/UnrealEnginePython.cpp @@ -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