Improve reading of CSV files of unknown charset

This should now work correctly with utf-8 and windows-1252 (and therefore iso-8859-1) encoded CSV files.