I am facing issues regarding the filenames that were accented and found a function to sanitize the filenames, but I am not sure of if this will affect the filenames in database as well or will just rename the files?
Here is the code:
add_filter('sanitize_file_name', 'sa_sanitize_spanish_chars', 10);
function sa_sanitize_spanish_chars ($filename) {
return remove_accents( $filename );
}
Try below code in function file.