发布

  • fix(scripts): force UTF-8 stdout/stderr in design_system.py on Windows (#390)

    frostbyte_neo 发布于 2026-06-25 11:30:49 +00:00 | 90 次提交 在此版本后已推送到 main

    design_system.py prints box-drawing characters and swatches (--, OK marks,
    block swatches), but unlike search.py it never reconfigured stdout. On a
    non-UTF-8 Windows console (cp1252/gbk) running the CLI crashes with
    UnicodeEncodeError, the same failure reported in #112 for search.py.

    Mirror the wrapper search.py already uses: re-wrap stdout/stderr in a
    UTF-8 TextIOWrapper when the console encoding is not UTF-8. Applied to
    the source of truth and the synced cli/assets copy.

    Verified: the CLI runs clean under PYTHONIOENCODING=cp1252 (exit 0, no
    UnicodeEncodeError) while still emitting the box/swatch output;
    check:assets passes.

    Related to #112 (search.py is already fixed on main; this covers the
    remaining design_system.py instance).

    下载附件