byteArray 2 string

  • Thread starter Thread starter Lou
  • Start date Start date
Basically, you get the proper encoding object from the System.Text.Encoding
class and use its GetString method. Here is a sample using UTF8

byte[] byteArray = //fill array somehow;
System.Text.Encoding.UTF8.GetString(byteArray);

Similar properties exist for Ascii, full Unicode, and UTF7, there is also a
GetEncoding method that allows you to get an encoding by name(Windows-1252
or Shift-JIS, etc) or by codepage.
 
Back
Top