libmagic is the libraray used in file utility to search for file encoding based on heuristics.
QTextCodec::codecForUtfText is limited to detecting UTF-8 BOM encoded files.
If this fails QTextCodec::codecForLocale is used to decode all text files, which can be quite incaccurate.
When QTextCodec::codecForUtfText did not find a valid UTF-* file, use libmagic to find a TextCodec.
It can better confirmm UTF-8 presence.
latin-1 is used as default 8-bit ascii codex when libmagic cannot find a precise result.