Created
March 22, 2022 22:39
-
-
Save jsenin/de41467a7318f04898fa5945e91799af to your computer and use it in GitHub Desktop.
drop characters non visibles at filenames. Usually because mixed charset codifications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import shutil | |
files = glob.glob("/home/jorge/Music/**", recursive=True) | |
for current in files: | |
try: | |
new = current.encode('utf8', 'ignore') | |
shutil.move(current, new) | |
except Exception as exc: | |
print(str(exc)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment