UE4中FString转UTF8及UTF8转FString

FString转UTF8

1 FString szMsg = "test msg";
2 TCHAR* pSendData = szMsg.GetCharArray().GetData();
3 int32 nDataLen = FCString::Strlen(pSendData);
4 uint8* dst = (uint8*)TCHAR_TO_UTF8(pSendData);

UTF8转FString

1  TArray<uint8> receiveBuff;
2  RecvData(receiveBuff, buffLen));    
3    receiveBuff.Add(\0);
4    FString receiveMsg(reinterpret_cast<const char*>(receiveBuff.GetData()));

 

   

  

文章来自:http://www.cnblogs.com/DeepFlavor/p/6236410.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3