I am trying to use the Universal Encoding Detector (chardet) in Python to detect the most probable character encoding in a text file ('infile') and use that in further processing. While chardet is designed primarily for detecting the character encoding of webpages, I have found an example of it being used on individual text files. However, I cannot work out how to tell the script to set the most l