converting byte[] to string
-
hi all, hope some one can help me iv got a bit of a prob. iv got a server and client sending data using sockets and tcp/ip. The client sends the server some text and the server gets the byte[] array and then converts it into a string. For the most part it is ok, however there are some characters it can not convert. i am using System.Text.ASCIIEncoding.ASCII.GetString() to turn the byte array into a string. an example of a character it will not convert is §. any help would be grate. Thx
-
hi all, hope some one can help me iv got a bit of a prob. iv got a server and client sending data using sockets and tcp/ip. The client sends the server some text and the server gets the byte[] array and then converts it into a string. For the most part it is ok, however there are some characters it can not convert. i am using System.Text.ASCIIEncoding.ASCII.GetString() to turn the byte array into a string. an example of a character it will not convert is §. any help would be grate. Thx
The character is not an ASCII character. Try System.Text.UnicodeEncoding.Unicode.GetString Christian Graus - Microsoft MVP - C++