{"record":{"id":"a88237de58e3076d","repo":"sxyazi/yazi","slug":"invalid-wtf-8-sequence","errorCode":null,"errorMessage":"Invalid WTF-8 sequence","messagePattern":"Invalid WTF-8 sequence","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"yazi-shim/src/wtf8/wtf8.rs","lineNumber":41,"sourceCode":"\n// --- FromWtf8\npub trait FromWtf8 {\n\tfn from_wtf8(wtf8: &[u8]) -> Result<&Self>;\n}\n\nimpl FromWtf8 for OsStr {\n\tfn from_wtf8(wtf8: &[u8]) -> Result<&Self> {\n\t\t#[cfg(unix)]\n\t\t{\n\t\t\tuse std::os::unix::ffi::OsStrExt;\n\t\t\tOk(Self::from_bytes(wtf8))\n\t\t}\n\t\t#[cfg(windows)]\n\t\t{\n\t\t\tif super::valid_wtf8(wtf8) {\n\t\t\t\tOk(unsafe { Self::from_encoded_bytes_unchecked(wtf8) })\n\t\t\t} else {\n\t\t\t\tErr(anyhow::anyhow!(\"Invalid WTF-8 sequence\"))\n\t\t\t}\n\t\t}\n\t}\n}\n\nimpl FromWtf8 for std::path::Path {\n\tfn from_wtf8(wtf8: &[u8]) -> Result<&Self> { Ok(OsStr::from_wtf8(wtf8)?.as_ref()) }\n}\n\n// --- FromWtf8Vec\npub trait FromWtf8Vec {\n\tfn from_wtf8_vec(wtf8: Vec<u8>) -> Result<Self>\n\twhere\n\t\tSelf: Sized;\n}\n\nimpl FromWtf8Vec for OsString {\n\tfn from_wtf8_vec(wtf8: Vec<u8>) -> Result<Self> {","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/sxyazi/yazi/blob/94abcfa92f4ad3f0a1aef6c1ea083cfb8aa6c8c2/yazi-shim/src/wtf8/wtf8.rs#L23-L59","documentation":"Error \"Invalid WTF-8 sequence\" thrown in sxyazi/yazi.","triggerScenarios":"Thrown at yazi-shim/src/wtf8/wtf8.rs:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94abcfa92f4ad3f0a1aef6c1ea083cfb8aa6c8c2","analyzedAt":"2026-08-16T09:56:24.836Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}