This encoding method will work for text that is encoded utf-8 but if you want to do any file you should use:
byte[] fileContents = file.ReadAllBytes("testfile.txt");
NOT:
StreamReader sourceStream = new StreamReader("testfile.txt");
byte [] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());