Replace CGI.escape with URI.escape in client paths