Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, December 10, 2008 5:05 AM
Hi, I have to build an application send text through network. My problem is text format must be unicode. But some sample I found is only convert string to ASCII format.
All replies (3)
Wednesday, December 10, 2008 5:39 AM ✅Answered
System.Text.Encoding.Unicode.GetBytes("My Text");
Wednesday, December 10, 2008 5:41 AM ✅Answered
string str = "paritosh";
byte[] data = Encoding.Unicode.GetBytes(str);//from string to bytes
string st = Encoding.Unicode.GetString(data);// from byte array to string
Wednesday, December 10, 2008 5:49 AM
Ascii.GetBytes will return the string as an array of bytes, but it will do it in ascii format, not unicode.