Can't Package and cook the game version 4.11.2

Interestingly enough (I posted this initially on UDN) why InvalidParameterHandler gets NULL replies back from the offending code is a mystery, it wasn’t until I isolated the code and got valid data I knew what was happening. I’m not sure with the static/dynamic linking, one would have CRT checking (depending on CRT checking enabled or not) enabled and one wouldn’t so hides the issue rather than fixes it.

printf can print full character ranges 0-255 (I think) therefore it would be a problem for a UTF-8 code page as I don’t think there’s any translation for it. So you could still get errors along the way depending on what is being printed, time of day, whether you had breakfast etc. :slight_smile:

But, a sample rig is thus.

#include <stdio.h>
#include <tchar.h>
#include <stdlib.h>  
#include <fcntl.h>
#include <io.h>

void InvalidParameterHandler(
	wchar_t const* Expression,
	wchar_t const* Function,
	wchar_t const* File,
	unsigned int Line,
	uintptr_t Reserved)
{
	__asm int 3;
}

int main()
{
	_set_invalid_parameter_handler(InvalidParameterHandler);
	_setmode(_fileno(stdout), _O_U8TEXT);	// UE4 sets this when packaging via the editor or UFE by setting -utf8output.

	_tprintf(_T("might work\n"));			// won't work if compiled as multi-byte, will if compiled as UNICODE.
	wprintf(L"works\n");
	printf("doesn't work\n");
    return 0;
}