I'm webscraping, and when I'm saving the image, it seems like the encoding is changed when saving the file. For instance, in the filename, 'é'
becomes 'é'
. I'm capable of catching all these changes with this function:
def unify_filename(string):
return string.lower().strip().replace(',', ',').replace('%', '%').replace('ô', '