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 str = FString(reinterpret_cast<const char*>(receiveBuff.GetData()));

 

   

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM