Effective way to find any file’s Encoding
The StreamReader.CurrentEncoding property rarely returns the correct text file encoding for me. I’ve had greater success determining a file’s endianness, by analyzing its byte order mark (BOM). If the file does not have a BOM, this cannot determine the file’s encoding. *UPDATED 4/08/2020 to include UTF-32LE detection and return correct encoding for UTF-32BE /// <summary> … Read more