Hi,
I am using Lua and Unreal, meet some problem about FString and char* , when I pass chinese text, they can not be passed correctly
input PringLog(“nihao你好”)
output LogTemp: Warning: nihao??
static int PrintLog(lua_State* L)
{
FString log = ANSI_TO_TCHAR(lua_tostring(L, -1));
UE_LOG(LogTemp, Warning, TEXT("%s"), *log);
return 0;
}
static void RegisterUnrealFunction(lua_State* L)
{
lua_pushcfunction(L, PrintLog);
lua_setglobal(L, "PrintLog");
}