{"record":{"id":"26ec8cb17dd044f7","repo":"Zackriya-Solutions/meetily","slug":"invalid-temp-path-non-utf8","errorCode":null,"errorMessage":"Invalid temp path (non-UTF8)","messagePattern":"Invalid temp path \\(non-UTF8\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/decoder.rs","lineNumber":320,"sourceCode":"        \"Converting .{} to temporary WAV via ffmpeg: {} -> {}\",\n        input_path\n            .extension()\n            .and_then(|e| e.to_str())\n            .unwrap_or(\"unknown\"),\n        input_path.display(),\n        temp_path.display()\n    );\n\n    if let Some(cb) = progress_callback {\n        cb(0, \"Converting audio format with FFmpeg...\");\n    }\n\n    let input_str = input_path\n        .to_str()\n        .ok_or_else(|| anyhow!(\"Invalid input path (non-UTF8)\"))?;\n    let output_str = temp_path\n        .to_str()\n        .ok_or_else(|| anyhow!(\"Invalid temp path (non-UTF8)\"))?;\n\n    let mut command = Command::new(&ffmpeg_path);\n    command\n        .args([\n            \"-i\", input_str,\n            \"-vn\",                  // Strip video tracks\n            \"-acodec\", \"pcm_s16le\", // Output PCM WAV (Symphonia handles natively)\n            \"-y\",                   // Overwrite without prompt\n            output_str,\n        ])\n        .stdin(Stdio::null())\n        .stdout(Stdio::piped())\n        .stderr(Stdio::piped());\n\n    // Hide console window on Windows\n    #[cfg(target_os = \"windows\")]\n    {\n        use std::os::windows::process::CommandExt;","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/decoder.rs#L302-L338","documentation":"The same Path::to_str() UTF-8 conversion, applied to the generated temporary WAV path. The temp filename itself is pure ASCII (.meetily_decode_<random>.wav), so in practice this fires when the input file's parent directory contains non-UTF-8 bytes, making the joined temp path non-UTF-8 as well. It shares its root cause and remedy with 'Invalid input path (non-UTF8)'.","triggerScenarios":"Any import where the source directory has non-UTF-8 bytes in its name — the temp file is created in that directory specifically to stay on the same filesystem, inheriting the encoding problem.","commonSituations":"Importing from a folder named with legacy codepage characters (Windows) or raw byte names (Linux); the input path itself usually fails first with the sibling error.","solutions":["Move or rename the input file into a UTF-8-named directory and re-import.","Code fix: create the conversion temp under std::env::temp_dir() when the input's parent is non-UTF-8 (see exampleFix).","Validate the picked path for UTF-8 round-tripping at selection time and warn early."],"exampleFix":"// before\nlet temp_file = tempfile::Builder::new()\n    .prefix(\".meetily_decode_\").suffix(\".wav\")\n    .tempfile_in(parent_dir)?;\n\n// after — prefer a guaranteed-UTF-8 dir when the input's parent is not\nlet dir = if parent_dir.to_str().is_some() {\n    parent_dir\n} else {\n    std::env::temp_dir().as_path()\n};\nlet temp_file = tempfile::Builder::new()\n    .prefix(\".meetily_decode_\").suffix(\".wav\")\n    .tempfile_in(dir)?;","handlingStrategy":"validation","validationCode":"// Rust — when the input's parent is non-UTF-8, decode from a copied ASCII-safe path\nlet work_path = if path.to_str().is_some() { path.to_path_buf() } else { copy_to_temp(path)? };\nlet temp_file = tempfile::Builder::new().prefix(\".meetily_decode_\").suffix(\".wav\")\n    .tempfile_in(work_path.parent().unwrap_or(Path::new(\".\")))?;","typeGuard":null,"tryCatchPattern":"// identical remedy to 'Invalid input path (non-UTF8)': rename/move the source directory or decode from an ASCII-safe copy","preventionTips":["Create the conversion temp in a guaranteed-UTF-8 directory when the input's parent is not.","Keep generated temp names ASCII (the .meetily_decode_ prefix already is)."],"tags":["path-encoding","utf8","tempfile","import"],"backgroundTag":"non-utf8-file-path","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}