To figure out the proper encoding of a file using chardet

PHOTO EMBED

Tue Aug 02 2022 15:14:40 GMT+0000 (Coordinated Universal Time)

Saved by @ggriffin60 #python

import chardet
with open(files[0], 'rb') as file:
    print(chardet.detect(file.read()))
content_copyCOPY

https://python.plainenglish.io/processing-text-files-50k-with-python-contd-42ec47440fbd