Encode pathname when necessary on browsers that supply it decoded