fix zero width #500 (#627)

This commit is contained in:
CJ Pais 2026-01-20 10:14:01 +08:00 committed by GitHub
parent f38b52e123
commit cc129e9105
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,