quoting arguments correctly rather than converting them may be the best approach
It's pretty normal to expect that you need to quote spaces in the arguments for shell scripts
eg.
#!/bin/bash clear echo Downloading $1 echo `curl -
called so
./myscript http://www.foo.com "my file"
alternatively, avoid spaces with the '\' character as you call them
./myscript http://www.example.com my\ other\ filename\ with\ spaces
cms source share