URL Encode only file name
If you're worried about malicious characters in an uploaded file name, Craft already sanitizes them when uploading from the control panel.

Craft doesn't do this during Asset indexing because generally it's assumed that the files you're uploading are trusted files.

It sounds like that might not be true in your case, though. I can think of two options.


Write a Craft plugin that loops through all files in your upload folders and calls the same AssetsHelper and IOHelper sanitizing methods that Craft does.
Find some desktop application that does it before you upload the files. A quick Google search turned up this for OSX, and this for Windows.