Write a script that finds files and renames the file without corrupted characters (non-alphanumeric and underscores)
Check scandir to find the files http://php.net/manual/en/function.scandir.php
Check this thread to find non-alphanumeric characters PHP Regular expression - Remove all non-alphanumeric characters
So, you will get clean file names and as written on your database. If needed you can do the same operation on your database field too.