Symlink or Rename files with spaces?
I understand your pain!

Can you not simply use tools to read the filenames and filter those as required, thereby letting your development language do all the escaping etc. for you?

In Python, for example, that'd mean using something like: os.walk() or os.listdir().