{"record":{"id":"051c913ccf9723f5","repo":"zed-industries/zed","slug":"path-contains-invalid-utf-8","errorCode":null,"errorMessage":"Path contains invalid UTF-8","messagePattern":"Path contains invalid UTF-8","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/path/src/path.rs","lineNumber":117,"sourceCode":"                \"{left}{}{right}\",\n                if left.ends_with(self.primary_separator()) {\n                    \"\"\n                } else {\n                    self.primary_separator()\n                }\n            ))\n        }\n    }\n\n    pub fn join_path(\n        self,\n        left: impl AsRef<Path>,\n        right: impl AsRef<Path>,\n    ) -> anyhow::Result<PathBuf> {\n        let left = left\n            .as_ref()\n            .to_str()\n            .ok_or_else(|| anyhow::anyhow!(\"Path contains invalid UTF-8\"))?;\n        let right = right.as_ref();\n        let right_string = right\n            .to_str()\n            .ok_or_else(|| anyhow::anyhow!(\"Path contains invalid UTF-8\"))?;\n        let joined = self\n            .join(left, right_string)\n            .ok_or_else(|| anyhow::anyhow!(\"Path must be relative: {right:?}\"))?;\n        Ok(PathBuf::from(self.normalize(&joined)))\n    }\n\n    pub fn join_path_preserving_components(\n        self,\n        left: impl AsRef<Path>,\n        right: impl AsRef<Path>,\n    ) -> anyhow::Result<PathBuf> {\n        let left = left\n            .as_ref()\n            .to_str()","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/path/src/path.rs#L99-L135","documentation":"In join_path, the left-hand path could not be converted to a UTF-8 string (to_str returned None), so it cannot be joined under the platform's path rules. Some component of the base path contains non-UTF-8 bytes, which this API does not support.","triggerScenarios":"Thrown at crates/path/src/path.rs:117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Identify and fix the non-UTF-8 component in the base path (rename the file or directory)","Ensure callers pass paths already validated as UTF-8, e.g. by converting through AbsPath first"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}