I am developing a C# Server and a C++ Client. The C++ client sends some unicode strings to the server. This is OK. I have a string object and use the data() function to get the byte array and send it over the socket to the c# server. This is all ok. The server receives the message correctly. The problem is with the receiving. I receive the bytes from the c# server however I want a way to "convert" the bytes to the corresponding unicode string.
I tried to create a wide string object:
wstring str = wstring((wchar_t *) buff);
and extract the string via the c_str() function but the result string is not the string the server sends!!
Where the buff is a byte array(unsigned char array) which I receive from the socket.
Any help would be appreciated!!!