What you are doing should work. This test code demonstrates:
string test = "X" + '\0' + '\0';
Console.WriteLine(test.Length); // Prints 3
var bytes = Encoding.Unicode.GetBytes(test);
Console.WriteLine(bytes.Length); // Prints 6
bytes
contains the following byte values: 88, 0, 0, 0, 0, 0
- which is correct.
So I assume there's something wrong elsewhere with your code.