Bug: Cloud post-processing crashes on French text (UTF-8 boundary error)
Description
When using cloud post-processing (tested with both Mistral and OpenAI), the app crashes with a panic when the transcribed text contains French accented characters (é, è, ê, etc.). The crash occurs because a byte index falls inside a multi-byte UTF-8 character.
Local transcription with Parakeet V3 works fine. The crash only happens during the post-processing step.
Error log
Post-processing...
thread 'tokio-runtime-worker' (136) panicked at crates/whis-desktop/src/recording/pipeline.rs:177:37:
byte index 50 is not a char boundary; it is inside 'è' (bytes 49..51) of
`Un fait chier, putain, on peut pas choisir le modèle dans le logiciel. En fait, on se connecte à l'API, mais on peut pas choisir le modèle, ou alors comment ça fonctionne dans la plateforme ?`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Additional context
- Cloud transcription (without post-processing) also returns empty results most of the time — possibly related since the text might be truncated at a wrong byte boundary before being sent to the API.
- The issue is likely at
pipeline.rs:177 where a string slice uses a byte index instead of a char boundary. In Rust, string slicing with byte indices panics if the index falls inside a multi-byte UTF-8 character.
Environment
- OS: Fedora 43 KDE Plasma (Wayland)
- Whis version: 0.7.2 (Flatpak from Flathub)
- Hardware: ThinkPad X13 Gen 2 AMD
- Transcription provider: Local Parakeet V3
- Post-processing provider: OpenAI Cloud
- Language: French
Steps to reproduce
- Set transcription to Local Parakeet
- Set post-processing to OpenAI Cloud or Mistral Cloud
- Dictate any French sentence containing accented characters (é, è, ê, à, etc.)
- App crashes with the above panic
Expected behavior
Post-processing should handle UTF-8 text correctly regardless of language.
Suggested fix
At pipeline.rs:177, use char-boundary-safe string slicing instead of raw byte indexing. For example, use str::floor_char_boundary() (nightly) or find the nearest valid char boundary before slicing.
Bug: Cloud post-processing crashes on French text (UTF-8 boundary error)
Description
When using cloud post-processing (tested with both Mistral and OpenAI), the app crashes with a panic when the transcribed text contains French accented characters (é, è, ê, etc.). The crash occurs because a byte index falls inside a multi-byte UTF-8 character.
Local transcription with Parakeet V3 works fine. The crash only happens during the post-processing step.
Error log
Additional context
pipeline.rs:177where a string slice uses a byte index instead of a char boundary. In Rust, string slicing with byte indices panics if the index falls inside a multi-byte UTF-8 character.Environment
Steps to reproduce
Expected behavior
Post-processing should handle UTF-8 text correctly regardless of language.
Suggested fix
At
pipeline.rs:177, use char-boundary-safe string slicing instead of raw byte indexing. For example, usestr::floor_char_boundary()(nightly) or find the nearest valid char boundary before slicing.