Are you looking for something like this?
Encoding encoding = Encoding.GetEncoding(866);
string text = File.ReadAllText("foo.txt", encoding);
Suppose you need a code page of 866.
I don’t know enough about CP866 to find out if it will usually contain 0 bytes ... but if your text file is valid CP866, this should read it.
source
share