URL encode query parameters

This is necessary for the rename operation to work, as the destination
path contains slashes. We also handle Unicode characters here.
Ensure destination path contains a leading slash

For the rename operation to work, the destination path needs to contain
a leading slash.