Skip to content

Commit 7b89d52

Browse files
authored
Merge pull request 20tab#623 from slartibaartfast/iss602
Added TCHAR_TO_WCHAR to fix issue 602
2 parents 81b67e4 + ae7fd91 commit 7b89d52

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Source/UnrealEnginePython/Private/PyCommandlet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ int32 UPyCommandlet::Main(const FString& CommandLine)
9191
#if PY_MAJOR_VERSION >= 3
9292
argv[i] = (wchar_t*)malloc(PyArgv[i].Len() + 1);
9393
#if PLATFORM_MAC || PLATFORM_LINUX
94-
wcsncpy(argv[i], *PyArgv[i].ReplaceEscapedCharWithChar(), PyArgv[i].Len() + 1);
94+
wcsncpy(argv[i], (const wchar_t *) TCHAR_TO_WCHAR(*PyArgv[i].ReplaceEscapedCharWithChar()), PyArgv[i].Len() + 1);
9595
#elif PLATFORM_ANDROID
9696
wcsncpy(argv[i], (const wchar_t *)*PyArgv[i].ReplaceEscapedCharWithChar(), PyArgv[i].Len() + 1);
9797
#else

Source/UnrealEnginePython/Private/UnrealEnginePython.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void FUnrealEnginePythonModule::UESetupPythonInterpreter(bool verbose)
121121
for (int32 i = 0; i < Args.Num(); i++)
122122
{
123123
#if PY_MAJOR_VERSION >= 3
124-
argv[i] = (wchar_t *)(*Args[i]);
124+
argv[i] = (wchar_t *)(TCHAR_TO_WCHAR(*Args[i]));
125125
#else
126126
argv[i] = TCHAR_TO_UTF8(*Args[i]);
127127
#endif

0 commit comments

Comments
 (0)