Add legacy option to to_url_encoded