Generate a properly encoded url.
(Fixes navigation on OS X, possibly on other platforms.)