Question: So the issue is that when using c# the char is 4 bytes so "abc" is (65 0 66 0 67 0).

When inputing that to a wstring in c++ thru sending it in a socket i get the following output a.

How i am able to convert such a string to a c++ string?

Answer: 
I have been able to solve the issue by using a std::u16string.
Here is some example code

```
std::vector<char> data = { 65, 0, 66, 0, 67, 0 };
std::u16string string(&data[0], data.size() / 2);
// now string should be encoded right

```
> 
> using c# the char is 4 bytes
> 
> 
> 

No, in CSharp Strings are encoded in UTF16. Code units need at least two bytes in UTF16. For simple charachters a single code unit can represent a code point (e.g. 65 0).

On Windows wstring is usually UTF16 (2-4 Bytes) encoded, too. But on Unix/Linux wstring uses usually UTF32-Encoding (always 4 Bytes).

The Unicode code Point has the same numerical value compared to ASCII - therefore UTF-16 encoded ASCII text looks often like this: {num} 0 {num} 0 {num} 0...
See the details here: (<https://en.wikipedia.org/wiki/UTF-16>)

Could you show us some Code, how you constructed your wstring object?
The null byte is critical here, because it was the end marker for ASCII / ANSI Strings.