URLEncoder is being used in this case, but the path segments have different rules for encoding that full urls.