URI-encode filenames when showing links to client

Should also help with #986