Skip to content

Cloud post-processing crash on UTF-8 characters (French accents) - pipeline.rs:177 #40

Description

@yulazzz

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

  1. Set transcription to Local Parakeet
  2. Set post-processing to OpenAI Cloud or Mistral Cloud
  3. Dictate any French sentence containing accented characters (é, è, ê, à, etc.)
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions