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()));
时间: 2024-12-07 18:51:04