My program has to read files that use various encodings. They may be ANSI, UTF-8 or UTF-16 (big or little endian).
When the BOM (Byte Order Mark) is there, I have n
Here is how notepad does that
There is also the python Universal Encoding Detector which you can check.