{"record":{"id":"cdb75a3dcf713fb5","repo":"vuejs/vue-router","slug":"route-with-path-path-contains-unencoded-chara","errorCode":null,"errorMessage":"Route with path \"${path}\" contains unencoded characters, make sure your path is correctly encoded before passing it to the router. Use encodeURI to encode static segments of your path.","messagePattern":"Route with path \"(.+?)\" contains unencoded characters, make sure your path is correctly encoded before passing it to the router\\. Use encodeURI to encode static segments of your path\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/create-route-map.js","lineNumber":74,"sourceCode":"\nfunction addRouteRecord (\n  pathList: Array<string>,\n  pathMap: Dictionary<RouteRecord>,\n  nameMap: Dictionary<RouteRecord>,\n  route: RouteConfig,\n  parent?: RouteRecord,\n  matchAs?: string\n) {\n  const { path, name } = route\n  if (process.env.NODE_ENV !== 'production') {\n    assert(path != null, `\"path\" is required in a route configuration.`)\n    assert(\n      typeof route.component !== 'string',\n      `route config \"component\" for path: ${String(\n        path || name\n      )} cannot be a ` + `string id. Use an actual component instead.`\n    )\n\n    warn(\n      // eslint-disable-next-line no-control-regex\n      !/[^\\u0000-\\u007F]+/.test(path),\n      `Route with path \"${path}\" contains unencoded characters, make sure ` +\n        `your path is correctly encoded before passing it to the router. Use ` +\n        `encodeURI to encode static segments of your path.`\n    )\n  }\n\n  const pathToRegexpOptions: PathToRegexpOptions =\n    route.pathToRegexpOptions || {}\n  const normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict)\n\n  if (typeof route.caseSensitive === 'boolean') {\n    pathToRegexpOptions.sensitive = route.caseSensitive\n  }\n\n  const record: RouteRecord = {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/vuejs/vue-router/blob/680ccc68c506cca9be6207745043245d61fa715a/src/create-route-map.js#L56-L92","documentation":"vue-router detects non-ASCII (control/Unicode) characters in a route's static path and warns because the path regex will be built from unencoded characters, causing matching/URL issues in browsers. Static path segments should be percent-encoded by the developer.","triggerScenarios":"Declaring a path containing literal non-ASCII characters, e.g. { path: '/café' } or { path: '/中文' }, instead of the encoded form.","commonSituations":"Localized route URLs typed directly in source; paths copied from browser address bars where the display decodes percent-encoding; server config strings pasted into routes.","solutions":["Encode static segments with encodeURI: '/caf%C3%A9' instead of '/café'","Keep route paths ASCII and translate at the param/value level","Normalize/encode config-sourced paths before registering routes","Test that navigation to the encoded URL matches the route"],"exampleFix":"// before\n{ path: '/café', component: Cafe }\n// after\n{ path: '/caf%C3%A9', component: Cafe }","handlingStrategy":"validation","validationCode":"function isEncodedPath(p) {\n  return !/[^\\u0000-\\u007F]+/.test(p)\n}\n// usage: if (!isEncodedPath(route.path)) route.path = encodeURI(route.path)","typeGuard":"function isAscii(p) { return typeof p === 'string' && /^[\\x00-\\x7F]*$/.test(p) }","tryCatchPattern":null,"preventionTips":["Run encodeURI on static path segments containing non-ASCII characters","Keep route paths ASCII; localize via params or a lookup map","Add a lint/check step over route tables for non-ASCII characters"],"tags":["vue-router","routing","encoding","url"],"backgroundTag":"unencoded-route-path","analyzedSha":"680ccc68c506cca9be6207745043245d61fa715a","analyzedAt":"2026-09-02T19:19:01.204Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}