Repository navigation
fix(settings): emit Windows font family names as UTF-8 - #12602
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughWindows font discovery now configures PowerShell output encoding as UTF-8 before enumerating installed fonts. A test verifies that the encoding statement is the first statement in the generated command. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4db41408-87a9-4d52-9359-b61c29a37863
📥 Commits
Reviewing files that changed from the base of the PR and between 7956335 and 66be0b227ef9e3e44fdb2093a52a7bd2b17a9a10.
📒 Files selected for processing (2)
src/main/system-fonts.test.tssrc/main/system-fonts.ts
Windows PowerShell 5.1 can write localized font names with the console code page while Node always decodes stdout as UTF-8, which garbles Korean and other non-ASCII family names in the font picker. Force UTF-8 OutputEncoding before enumerating InstalledFontCollection (stablyai#12590).
66be0b2 to
6e511a2
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Lock script order so OutputEncoding is set before InstalledFontCollection enumeration, preventing a silent regression of the mojibake fix.
Linked duplicate closedClosing draft #12595 as the same fix for #12590 (Windows font family names need UTF-8 PowerShell output). Extra notes:
|
|
Thanks for the triage on #12595. Nothing outstanding here:
Ready whenever you have a review slot. One ask: the Actions suite on the current head is sitting at |
`$OutputEncoding` only governs bytes piped to a native executable's stdin; this script pipes to ForEach-Object, so it was inert. Drop it, and drop the script-builder export whose only consumer was a test — the one-shot `-Command` shape now matches windows-foreground-process-rows and ssh-browse, while the BOM-less `UTF8Encoding::new($false)` spelling matches powershell-osc133-bootstrap and antigravity/hook-service. The test reaches the script through the public listSystemFontFamilies path and pins the assignment as the script's first statement, so it fails on removal, on a stdout write above it, and on a swapped encoding.
|
@brennanb2025 thanks for the cut-down — dropping |
|
Thanks for this — the diagnosis is exactly right, and the one-line encoding pin is what ships. Heads-up that I pushed a commit to your branch (
Worth knowing: on localized systems the picker list will get longer after this, because distinct families previously decoded to the same run of replacement characters and were deduped into one entry. Two follow-ups I noticed but deliberately left out of this PR:
|
|
@brennanb2025 thank you for landing this — and for the earlier cut-down that kept the one-shot |
|
Thanks for the PR!! Appreciate the support 🙏 |
* fix(settings): emit Windows font family names as UTF-8 Windows PowerShell 5.1 can write localized font names with the console code page while Node always decodes stdout as UTF-8, which garbles Korean and other non-ASCII family names in the font picker. Force UTF-8 OutputEncoding before enumerating InstalledFontCollection (stablyai#12590). * test(settings): assert UTF-8 pin precedes Windows font enumeration Lock script order so OutputEncoding is set before InstalledFontCollection enumeration, preventing a silent regression of the mojibake fix. * refactor(settings): cut the Windows font UTF-8 pin to the standard shape `$OutputEncoding` only governs bytes piped to a native executable's stdin; this script pipes to ForEach-Object, so it was inert. Drop it, and drop the script-builder export whose only consumer was a test — the one-shot `-Command` shape now matches windows-foreground-process-rows and ssh-browse, while the BOM-less `UTF8Encoding::new($false)` spelling matches powershell-osc133-bootstrap and antigravity/hook-service. The test reaches the script through the public listSystemFontFamilies path and pins the assignment as the script's first statement, so it fails on removal, on a stdout write above it, and on a swapped encoding. --------- Co-authored-by: Brennan Benson <[email protected]>
Summary
[Console]::OutputEncodingto UTF-8 before enumeratingInstalledFontCollection.Fixes #12590
Test plan
vitestsrc/main/system-fonts.test.ts(6/6)