void Log(const char* s, int32 len)
{
// TODO: Can we get rid of that allocation?
FString LogString = FString(len, UTF8_TO_TCHAR(s));
UE_LOG(LogTemp, Warning, TEXT("%s"), *LogString);
}
I'm not sure whether UTF8_TO_TCHAR(s) will lead to undefined behavior. This MACRO will call utf8 conversion of option ENullTerminatedString::Yes, but rust native string end with no \0
Maybe use
(TCHAR*)FUTF8ToTCHAR((const ANSICHAR*)str, (int32)len).Get()
should be safer?
I'm not sure whether UTF8_TO_TCHAR(s) will lead to undefined behavior. This MACRO will call utf8 conversion of option ENullTerminatedString::Yes, but rust native string end with no \0
Maybe use
should be safer?