Skip to content

fix(windows): preserve Unicode capture helper arguments - #1153

Open
xiangchiqingyu wants to merge 1 commit into
webadderallorg:mainfrom
xiangchiqingyu:fix/windows-unicode-helper-args
Open

xiangchiqingyu wants to merge 1 commit into
webadderallorg:mainfrom
xiangchiqingyu:fix/windows-unicode-helper-args

Conversation

@xiangchiqingyu

@xiangchiqingyu xiangchiqingyu commented Oct 20, 2026 •

Copy link
Copy Markdown

Description

Fix Unicode command-line argument handling in the Windows WGC native capture helper.

Motivation

Native Windows capture can fall back to browser capture when the temporary path contains non-ASCII characters, such as a Windows username written in Chinese.

The helper previously used main(char* argv[]), so the JSON configuration argument could be decoded through the system ANSI code page and corrupt Unicode file paths before Media Foundation created the output file.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

Follow-up to #517.

Screenshots / Video

Not applicable. This change only affects native Windows command-line/path handling.

Testing Guide

  1. Use a Windows account whose %TEMP% path contains non-ASCII characters.
  2. Start a full-screen recording with native Windows capture enabled.
  3. Verify that recording starts without the “Native Windows capture failed to start. Falling back to browser capture.” message.

I reproduced the original fallback on Windows 10. Using an ASCII-only temporary directory allowed native capture to work, which isolated the problem to Unicode command-line/path handling.

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows configuration handling to correctly support non-ASCII characters.
    • Prevented configuration parsing issues caused by character encoding differences.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: webadderallorg/Recordly/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 05329bd1-33af-4067-bacb-823e8e03023d
📥 Commits

Reviewing files that changed from the base of the PR and between e4a9d04 and 3d20de1.

📒 Files selected for processing: 1
  • electron/native/wgc-capture/src/main.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The Windows capture program now uses wmain and converts its wide-character JSON command-line argument to UTF-8 before parsing.

Changes: Windows JSON argument encoding

Layer / File(s) Summary
Convert and parse the command-line argument
electron/native/wgc-capture/src/main.cpp
The program adds wideToUtf8, changes the entry point to wmain, and passes the converted JSON argument to parseSimpleJson. The helper returns an empty string for empty input.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: webadderall

Merge Risk: ⚪ Minimal · up to 3d20d

The Unicode path handling fix is supported by the inspected producer, parser, and Windows build configuration.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving Unicode arguments for the Windows capture helper.
Description check Passed The description explains the problem, motivation, bug-fix scope, related issue, testing steps, and checklist status. It matches the pull request changes.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant