Repository navigation
fix(captions): read whisper-stt paths as UTF-8 on Windows - #1407
Conversation
The helper read --model, --vad-model and the OPENSCREEN_* variables through char** argv and getenv(), which Windows hands over in the ANSI code page. whisper.cpp converts every path as UTF-8, so a model under a non-ASCII profile folder crashed the boot with 0xC0000409. Read the wide command line and environment instead, open the CTC model and the temp WAV through wide paths too. Refs #1405
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Windows arguments and environment handling electron/native/whisper-stt/src/main.cpp, electron/native/whisper-stt/CMakeLists.txt |
Windows arguments and environment values use wide-character APIs and UTF-8 conversion. Argument parsing retains its fallback and existing precedence rules. The Windows server links with shell32. |
Filesystem paths for audio and model files electron/native/whisper-stt/src/main.cpp, electron/native/whisper-stt/src/ctc_aligner.cpp |
WAV paths use std::filesystem::path, and Windows model-file loading converts UTF-8 paths before opening them with _wfopen. WAV open-failure messages report the filename. |
Priority:
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related issues
- getopenscreen/openscreen#1405 describes a Windows captions-helper failure with non-ASCII user profile paths. This change adds UTF-8 argument and environment handling and wide-character file APIs for that path scenario.
Suggested reviewers: cybersparkx
Merge Risk: 
Minimal · up to 60048
-
The Windows path changes are consistent with the model-loading interfaces inspected. No merge-blocking issue was identified; normal build and platform checks remain appropriate.
Pre-merge checks: 
3 · 
2
-
Failed checks: 2 warnings Passed checks: 3 passedFull details: Description check
-
Explanation
The description provides a detailed summary, issue reference, implementation details, and testing results. However, it omits the required Summary, Type of change, Release impact, and Desktop impact sections, and it does not select the applicable checkboxes.
Resolution
Add the required template sections. Mark Bug fix, Patch, and Windows. Retain the existing testing details and issue reference. State whether screenshots are not applicable if needed.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Refs #1405
On Windows, a profile folder with non-ASCII characters (e.g.
C:\Users\홍길동\) killedwhisper-stt-server.exeat boot with0xC0000409. The helper read--modeland theOPENSCREEN_*variables throughchar** argv/getenv(), which Windows fills in the ANSI code page, while whisper.cpp converts every path as UTF-8.Huge thanks to @pgkang0619 for the precise diagnosis and the patch this builds on.
Changes (Windows only, other platforms unchanged)
CommandLineToArgvW(GetCommandLineW()), env from_wgetenv, both converted to UTF-8 (shell32linked)./emissions): opened with_wfopenon the UTF-8 path. Notggml_fopen: the helper links the CRT statically, so aFILE*fromggml.dllcrashed on read.std::filesystem::path, since.string()converts to ANSI and throws under a non-ASCIITEMP.spawnalready passes UTF-16 arguments.Proof (CPU build, model + VAD + CTC model and
TEMPunder the test folder, short LibriSpeech clip)main%TEMP%\Café0xC0000409at boot/inference200 with the right text,/emissions200%TEMP%\홍길동???/inference200,/emissions200Not covered: the Vulkan build, macOS and Linux (code path unchanged there), a real Korean-locale Windows.
🤖 Generated with Claude Code
Summary by CodeRabbit