No one should have allowed filenames to contain spaces in the first place...

I've always known that to cause more trouble than it'll ever be worth.

My advice: do as I do and never use spaces in filenames. Nor accented letters or any of that crap. With the possibility of 255 characters in a filename, abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-. should more than suffice to form an adequate number of unique filenames in a single directory. (Or even with only 26 letters on case insensitive filesystems.)