urlencode document to ensure there are no style issues