I have a byte[] array that is loaded from a file that I happen to known contains UTF-8.
byte[]
In some debugging code, I need to convert it to a string. Is
In adition to the selected answer, if you're using .NET35 or .NET35 CE, you have to specify the index of the first byte to decode, and the number of bytes to decode:
string result = System.Text.Encoding.UTF8.GetString(byteArray,0,byteArray.Length);