G
Guest
I am writing a client in C# that needs to communicate over the network to a legacy C++ application that uses Unicode strings. I realize that C# strings are already in Unicode, however, how do I account for the network order transformation. Can I simply do the equivalent of
string = "hello world"; // this is a unicode strings (2 bytes per char)
bytes[] buffer = UnicodeEncoding.GetBytes(str);
myNetworkStream.Write(buffer, 0, buffer.Length);
I guess, if the client and server are both on the same architecture then this isn't an issue. However, what if my legacy server is on Unix (Solaris) ? Won't the byte ordering/endianness create problems ?
Much Thanks,
Srikant
string = "hello world"; // this is a unicode strings (2 bytes per char)
bytes[] buffer = UnicodeEncoding.GetBytes(str);
myNetworkStream.Write(buffer, 0, buffer.Length);
I guess, if the client and server are both on the same architecture then this isn't an issue. However, what if my legacy server is on Unix (Solaris) ? Won't the byte ordering/endianness create problems ?
Much Thanks,
Srikant