I have a project in which most of the files are UTF-16 but one is UTF-8. Having put the correct encoding ("utf_8" or "utf_16") into strOpenEncoding, I tried this:
for strInput in open(strInputFileName, "r", newline="\n", encoding=strOpenEncoding):
I get this response:
UnicodeError: UTF-16 stream does not start with BOM
I have opened the file it is trying to open manually, and it definitely contains a byte-order mark and is definitely UTF-16. What am I doing wrong?