Repository navigation
fix(fonts): decode Windows font names as UTF-8 - #12595
dpfwpfahs1-coder wants to merge 1 commit into
Conversation
|
Verification verdict: PASS for the scoped Windows font UTF-8 fix at commit Evidence:
Root cause: Windows PowerShell could emit localized family names in a non-UTF-8 console/OEM code page while Node decoded stdout as UTF-8. The patch makes the producer match the existing decoder. Verification limits:
Cross-platform and security review found no macOS/Linux behavior change, no new input or interpolation, no IPC/auth/dependency change, and negligible performance impact. |
|
Duplicate of #12602 (fixes #12590). Same root cause and intended fix: force Windows PowerShell font enumeration to emit UTF-8 so localized font names are not mojibake. Please continue review/landing on #12602. If this draft branch has a meaningfully different implementation detail worth cherry-picking, call it out on #12602. |
Summary
Fixes #12590.
Windows font discovery now pins the PowerShell script's stdout to UTF-8 before it emits installed font family names. This prevents localized names such as
굴림,휴먼명조, andG마켓 산스 Mediumfrom becoming mojibake in the Settings font picker.execFileText()already decodes stdout as UTF-8, but Windows PowerShell 5.1 can emit redirected text in the active console/OEM code page. The previous producer/consumer encoding mismatch corrupted non-ASCII family names. The fix makes the producer explicitly match the existing UTF-8 decoder.The new regression test verifies both sides of the contract: the Windows script requests UTF-8 output and Korean family names survive parsing unchanged.
This is separate from #7573 (renderer-side list truncation) and #11771 / #11785 (PowerShell launch failure). It composes with #11785 because the output-encoding line is part of the shared script and works in both Windows PowerShell and PowerShell 7.
Screenshots
No visual change to the UI itself. The user-visible change is that localized entries in the existing font picker are readable.
Testing
pnpm lint— implementation lint, type-aware lint, reliability gates, and max-lines checks passed; the full command then stopped because upstream generated skill artifacts are stale (resources/skills/current-manifest.json,snapshot-registry.json, andrelease-mapping.json). This PR does not touch those files.pnpm typecheckpnpm test— the full repository run did not finish within 10 minutes and was terminated; no final suite result was produced.pnpm buildAdditional focused verification:
pnpm exec vitest run src/main/system-fonts.test.ts --config config/vitest.config.ts— 5/5 passed.pnpm exec oxlint src/main/system-fonts.ts src/main/system-fonts.test.ts --deny-warnings— passed.pnpm exec oxfmt --check src/main/system-fonts.ts src/main/system-fonts.test.ts— passed.휴먼명조intact.AI Review Report
The final two-file diff was reviewed for platform, runtime, performance, UI, and integration risk:
win32branch. macOSsystem_profilerand Linuxfc-listbehavior is unchanged.[System.Text.UTF8Encoding]::new($false)is supported by Windows PowerShell 5.1 and PowerShell 7.No further code changes were needed after review.
Security Audit
Notes