Text files Unicode charset w/wo BOM detector. Encodings supported:
UTF-7
UTF-8
UTF-16
UTF-32
Example application can be found here.
// Get file encoding.
var unicodeCharsetDetector = new UnicodeCharsetDetector.UnicodeCharsetDetector();
using var stream = File.OpenRead(fileName);
var charset = unicodeCharsetDetector.Check(stream);
var encoding = charset.ToEncoding();