Skip to content

armgit / Handy

Public Imported from GitHub
0

A free, open source, and extensible speech-to-text application that works completely offline.

fix zero width #500 (#627)

CJ Paiscc129e910555
diff --git a/src-tauri/src/actions.rs b/src-tauri/src/actions.rs
index 8232dedc..5eb5c0ee 100644
--- a/src-tauri/src/actions.rs
+++ b/src-tauri/src/actions.rs
@@ -141,6 +141,12 @@ async fn maybe_post_process_transcription(
.await
{
Ok(Some(content)) => {
+ // Strip invisible Unicode characters that some LLMs (e.g., Qwen) may insert
+ let content = content
+ .replace('\u{200B}', "") // Zero-Width Space
+ .replace('\u{200C}', "") // Zero-Width Non-Joiner
+ .replace('\u{200D}', "") // Zero-Width Joiner
+ .replace('\u{FEFF}', ""); // Byte Order Mark / Zero-Width No-Break Space
debug!(
"LLM post-processing succeeded for provider '{}'. Output length: {} chars",
provider.id,