How to convert byte array of uint8 to readable FString?

TArray<uint8> ReceiveData;

FString result = FString(UTF8_TO_TCHAR(ReceiveData.GetData())); ← not safe enough

this works for non-ansi wide char , “像是中文”

FString result = FString(ReceiveData.Num(), UTF8_TO_TCHAR(ReceiveData.GetData())); ← this one better

7 Likes