fix(skill): make skill initialization safe on Windows pipes (#421)

## Summary
- Keep the caller's stdout encoding and escape only characters it cannot
represent. This prevents the normal skill initializer command from
aborting on legacy-encoded Windows pipes and preserves Unicode output on
UTF-8 streams.
- Write all generated skill templates as UTF-8 so the localized content
does not depend on the machine locale.
- Exercise the actual CLI with CP1252 and UTF-8 output in the i18n
validation workflow, including a non-ASCII destination, generated
localized files, and duplicate-directory errors.

## Validation
- Reproduced UnicodeEncodeError with the unmodified CLI and CP1252
stdout; both focused regression tests pass on the change.
- Catalog and i18n validation passed with zero errors; translation
freshness and `git diff --check` passed.
- No new dependencies or metadata changes. A native installed-app
confirmation still belongs to the consuming product after syncing the
bundled Market seed.
This commit is contained in:
yige authored and GitHub committed 2026-12-02 11:39:40 +08:00
1 parent 55588fd33f
commit 39370aba29
3 files changed
+105 -5

No files matched your search

+4
View File
@@ -62,6 +62,10 @@ jobs:
if: steps.changes.outputs.relevant == 'true'
run: uv run --quiet scripts/i18n/test_validate_i18n.py
- name: Run skill-creator CLI encoding tests
if: steps.changes.outputs.relevant == 'true'
run: python3 -B scripts/catalog/test_skill_creator_cli.py
- name: Run Office launcher contract tests
if: steps.changes.outputs.relevant == 'true'
run: python3 -B scripts/office/test_runtime_launcher.py