I have used the code below to write the file.
File.WriteAllText(fileName, data, Encoding.Unicode);
When I read the file using code below because the type of File Encoding is run time specific.
using (StreamReader sR = File.OpenText(fileName))
{
encoding = sR.CurrentEncoding;
}
I get Encoding.UTF8
I've also used the methods in This Link
Can anyone suggest the working way to find the Encoding?
Thanks