Skip to content

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

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

xiangchiqingyu wants to merge 1917 commits 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.

webadderall and others added 30 commits September 2, 2026 20:27
…ws-recording-reliability

Fix Windows recording lifecycle, webcam sync, and captions
…ture-protection

Keep the HUD out of recordings across capture backends
…-platform-update-toast-visibility

Fix invisible update notifications on Windows and Linux
…indow-recording-crop

Record selected windows by cropping full-screen captures
…e-console-eio

Prevent closed console streams from crashing Recordly
webadderall and others added 28 commits October 10, 2026 13:43
…rdly-user-system-and-capture-picker

Add source selection and authenticated account and permission settings
The renderer passes the microphone's enumerateDevices() label to the
ScreenCaptureKit helper, which resolves it by exact comparison with
AVCaptureDevice.localizedName. Chromium decorates that label with a
transport suffix ("Shure MV7 (14ed:1012)", "MacBook Pro Microphone
(Built-in)", "BlackHole 16ch (Virtual)"), so the comparison failed for
almost every device and the helper silently recorded the system default
input instead. With the lid closed that default is the built-in mic,
which delivers digital silence, so recordings came out without a voice.

Try the raw label first, then the label without its trailing
parenthetical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the microphone by exact label, then by a device ID that names a
real capture device, and only then by the label without Chromium's
transport suffix, so the name heuristic cannot override a precise
identifier.

Move the matching into a pure function and replace the source-text
assertions with a test that compiles it with swiftc and checks the
results against a fixed device list, following the lifecycle test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	src/lib/exporter/modernFrameRenderer.ts
# Conflicts:
#	src/components/video-editor/videoPlayback/clipPlayback.ts
…rt-audio-merge-validation

Fix Lightning export fallback, companion audio routing, and seek playback
…label-match

fix(macos): match the selected microphone when Chromium adds a label suffix
…rackle-windows

fix: disable mic AGC by default to stop Windows audio crackle
…audio-gap-timing

Preserve macOS audio timing through encoder stalls
@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.