Zackriya-Solutions/meetily · error
Invalid input path (non-UTF8)
Error message
Invalid input path (non-UTF8)
What it means
Before spawning ffmpeg, both paths are converted with Path::to_str(), which returns None unless the entire path is valid UTF-8; this variant covers the input file path. Paths containing bytes that don't decode as UTF-8 (legacy-codepage filenames on Windows, undecodable byte sequences on Linux/macOS) cannot be passed as &str to Command arguments. Because the temp WAV is created in the same directory, a non-UTF-8 parent usually triggers the sibling 'Invalid temp path (non-UTF8)' error too.
Source
Thrown at frontend/src-tauri/src/audio/decoder.rs:317
let temp_path = temp_file.into_temp_path();
info!(
"Converting .{} to temporary WAV via ffmpeg: {} -> {}",
input_path
.extension()
.and_then(|e| e.to_str())
.unwrap_or("unknown"),
input_path.display(),
temp_path.display()
);
if let Some(cb) = progress_callback {
cb(0, "Converting audio format with FFmpeg...");
}
let input_str = input_path
.to_str()
.ok_or_else(|| anyhow!("Invalid input path (non-UTF8)"))?;
let output_str = temp_path
.to_str()
.ok_or_else(|| anyhow!("Invalid temp path (non-UTF8)"))?;
let mut command = Command::new(&ffmpeg_path);
command
.args([
"-i", input_str,
"-vn", // Strip video tracks
"-acodec", "pcm_s16le", // Output PCM WAV (Symphonia handles natively)
"-y", // Overwrite without prompt
output_str,
])
.stdin(Stdio::null())
.stdout(Stdio::piped())
.stderr(Stdio::piped());
// Hide console window on WindowsView on GitHub (pinned to 0281737d87)
Solutions
- Rename the file (and its non-ASCII parent folders) to UTF-8-safe characters and re-import.
- On Windows, ensure the filename was created with a Unicode-capable encoding; avoid legacy codepage names.
- Code fix: copy the input to an ASCII-named temp file and decode that when to_str() is None (see exampleFix).
Example fix
// before
let input_str = input_path.to_str()
.ok_or_else(|| anyhow!("Invalid input path (non-UTF8)"))?;
// after — copy to an ASCII-named temp file when the path is not UTF-8
let input_str = match input_path.to_str() {
Some(s) => s.to_string(),
None => {
let safe = std::env::temp_dir().join(format!(
"meetily_import.{}",
input_path.extension().and_then(|e| e.to_str()).unwrap_or("bin")
));
std::fs::copy(input_path, &safe)?;
safe.to_str().ok_or_else(|| anyhow!("temp_dir is not UTF-8"))?.to_string()
}
}; Defensive patterns
Strategy: validation
Validate before calling
// Rust — reject early with a fixable message
if input_path.to_str().is_none() {
return Err(anyhow!("File path contains non-UTF-8 characters — rename the file/folders and re-import."));
} Try / catch
match decode_audio_file(&path, None) {
Err(e) if e.to_string().contains("non-UTF8") => { /* prompt the user to rename the file */ }
other => other,
} Prevention
- Sanitize imported filenames to UTF-8 at pick time.
- Copy to an app-managed, ASCII-safe path immediately after file selection.
- Keep Windows test assets with legacy-codepage names in CI to catch regressions.
When it happens
Trigger: Importing a file whose name or parent directories contain non-UTF-8 bytes: files created by old Windows apps using ANSI codepages, downloads with mangled byte names on Linux, or files moved from filesystems that permit arbitrary bytes (ext4) into the app.
Common situations: Cross-platform file sharing with legacy encodings, archived files with odd names, or test assets saved with a non-Unicode codepage.
Related errors
- Invalid temp path (non-UTF8)
- FFmpeg not found. FFmpeg is required to decode .{} files. It
- Failed to create temporary WAV file: {}
- Failed to spawn ffmpeg process: {}
- Failed to wait for ffmpeg process: {}
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/c801294b0dbc16c9.
Report an issue: GitHub.