I'm parsing a file that's written in UTF16-LE for fairly simple matches and none of them seem to trigger. For example, I have the following code.
with open(filepath) as f:
for line in f:
if 'TEST_CASE' in line:
print(line)
Is there a good way to check the lines in the file for matches without altering the file itself?
As per my comment codecs.open('filename', encoding='utf-16-le')