Skip to content

[BUG] Custom Words function fails on Chinese phrases #1705

Description

@DtDEncryption

Bug Description

When custom words contain chinese phrases, transcription process would be stuck unless cancelled manually.

The log below contain two examples. The former one is the successful one, the latter one is the one that matches a custom word ("中州韵输入法") set in Handy.

System Information

App Version: v0.9.3

Operating System: Fedora 44

CPU: AMD Ryzen 5 8500 w

GPU: NVIDIA GeForce RTX 3060

Logs

[2026-07-17][09:44:08][handy_app_lib::managers::model][INFO] Seeded 65 catalog model(s) into the registry
[2026-07-17][09:44:08][handy_app_lib::managers::history][INFO] Initializing database at "/home/***/.local/share/com.pais.handy/history.db"
[2026-07-17][09:44:08][transcribe_cpp][INFO] load_backend: loaded Vulkan backend from /usr/lib/libggml-vulkan.so
[2026-07-17][09:44:08][transcribe_cpp][INFO] load_backend: loaded CPU backend from /usr/lib/libggml-cpu-zen4.so
[2026-07-17][09:44:08][transcribe_cpp][INFO] transcribe_init_backends: 3 compute device(s) registered after scanning /usr/lib: Vulkan0, Vulkan1, CPU
[2026-07-17][09:44:08][handy_app_lib::managers::transcription][INFO] transcribe-cpp initialized with 3 compute device(s): [Vulkan0 (vulkan), Vulkan1 (vulkan), CPU (cpu)]
[2026-07-17][09:44:08][handy_app_lib::managers::transcription][INFO] transcribe.cpp accelerator preference: Auto (applied on next model load)
[2026-07-17][09:44:08][handy_app_lib::managers::transcription][INFO] ORT accelerator set to: auto
[2026-07-17][09:44:08][handy_app_lib::commands][INFO] Enigo initialized successfully after permission grant
[2026-07-17][09:44:08][handy_app_lib::commands][INFO] Shortcuts initialized successfully
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM pulse
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM pulse
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM jack
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM jack
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM oss
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM oss
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM pulse
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM pulse
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM jack
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM jack
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM oss
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM oss
[2026-07-17][09:44:12][handy_app_lib::managers::transcription][INFO] transcribe.cpp accelerator preference: Auto (applied on next model load)
[2026-07-17][09:44:12][handy_app_lib::managers::transcription][INFO] ORT accelerator set to: auto
[2026-07-17][09:44:12][handy_app_lib::audio_toolkit::audio::recorder][INFO] Using device: Ok("default")
Sample rate: 44100
Channels: 1
Format: F32
[2026-07-17][09:44:12][handy_app_lib::managers::audio][INFO] Microphone stream initialized in 41.768652ms
[2026-07-17][09:44:12][transcribe_cpp][INFO] qwen3_asr: using vulkan backend: Vulkan0
[2026-07-17][09:44:13][handy_app_lib::managers::transcription][INFO] Loaded whisper model 'handy-computer/Qwen3-ASR-1.7B-gguf/Qwen3-ASR-1.7B-Q5_K_M.gguf' (requested Auto, gpu_device 0, bound backend 'Vulkan0', supports_streaming=false, supports_translate=false, supports_language_detect=true)
[2026-07-17][09:44:13][handy_app_lib::managers::transcription][INFO] Transcription completed in 0.10s for 1.25s of audio (11.98x real-time)
[2026-07-17][09:44:13][handy_app_lib::managers::transcription][INFO] Transcription result: 看得见吗?
[2026-07-17][09:44:13][handy_app_lib::clipboard][INFO] Using paste method: Direct, delay before: 60ms, delay after: 60ms
[2026-07-17][09:44:13][handy_app_lib::clipboard][INFO] Using user-specified kwtype
[2026-07-17][09:44:15][handy_app_lib::audio_toolkit::audio::recorder][INFO] Using device: Ok("default")
Sample rate: 44100
Channels: 1
Format: F32
[2026-07-17][09:44:15][handy_app_lib::managers::audio][INFO] Microphone stream initialized in 11.887134ms

thread 'tokio-runtime-worker' (1061938) panicked at src/audio_toolkit/text.rs:220:14:
start byte index 20 is not a char boundary; it is inside '。' (bytes 18..21 of string)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2026-07-17][09:44:40][handy_app_lib::utils][INFO] Initiating operation cancellation...
[2026-07-17][09:44:40][handy_app_lib::utils][INFO] Operation cancellation completed - returned to idle state

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