Skip to content

Instantly share code, notes, and snippets.

@xtman
Created September 20, 2022 08:02
Show Gist options
  • Save xtman/0dcbe2fb78e4a1a744e172d083f76108 to your computer and use it in GitHub Desktop.
Save xtman/0dcbe2fb78e4a1a744e172d083f76108 to your computer and use it in GitHub Desktop.
python code to detect file name encoding
import os
import chardet
for n in os.listdir('.'):
print(chardet.detect(os.fsencode(n)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment