When GUI programs mishandle filenames with spaces, IME it's usually because they spawn a subshell in a naive way (system("rm " + filename)).
To mishandle spaces you have to split an input w/ filenames by whitespace, which is not that common of an operation outside of a shell.