title: C++ Convert UTF Byte Array to String
body: <p>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.</p>
  
  <p>I tried to create a wide string object:</p>
  
  <pre><code>wstring str = wstring((wchar_t *) buff);
  </code></pre>
  
  <p>and extract the string via the c_str() function but the result string is not the string the server sends!!</p>
  
  <p>Where the buff is a byte array(unsigned char array) which I receive from the socket.</p>
  
  <p>Any help would be appreciated!!!</p>