Skip to content

fix(desktop): prevent Windows CE bootstrap encoding crash - #20

Merged
Luhaozhu merged 1 commit into
mainfrom
fix/windows-ce-bootstrap-encoding
Jul 23, 2026
Merged

fix(desktop): prevent Windows CE bootstrap encoding crash#20
Luhaozhu merged 1 commit into
mainfrom
fix/windows-ce-bootstrap-encoding

Conversation

@Luhaozhu

Copy link
Copy Markdown
Contributor

Summary / 概述

Fix packaged Windows CE desktop builds exiting during the first local-server
startup after the default-plugin readiness changes from #19.

The desktop launcher redirects Python stdout and stderr to server.log. On
Windows systems where the redirected stream selected GBK, printing the
status symbol raised UnicodeEncodeError inside the plugin and site-template
bootstrap try blocks. Successful work was consequently reported as failed,
and strict readiness terminated the backend before the desktop window became
usable.

This change:

  • forces UTF-8 for the Python child process launched by the Tauri desktop shell;
  • makes CLI status output safe on legacy code pages;
  • separates status rendering from plugin and template operation results so a
    log encoding problem cannot change readiness state; and
  • adds regression coverage for GBK-redirected output and the desktop launcher
    environment contract.

Related issue / 关联 Issue

Follow-up to #19.

Type of change / 变更类型

  • 📖 Documentation (document/**, README*.md)
  • 🧩 Example / sample (examples/**)
  • 🔧 Repo meta (CI, templates, .github/**)
  • Other (please describe / 请说明): Windows CE desktop startup bug fix and regressions.

Checklist / 检查项

  • My change only touches non-generated paths (docs / examples / repo meta). 仅改动非生成路径。
  • Links and code snippets were verified. 链接与代码片段已验证。
  • For bilingual docs, I updated both document/en/** and document/zh-CN/** where applicable. 双语文档已同步更新(如适用)。
  • I read CONTRIBUTING.md. 我已阅读贡献指南。

Validation:

  • strict CE derivation passed required-runtime, forbidden-artifact, binary,
    brand, license, import/OpenAPI/ORM, pytest-collection, and frontend-build gates;
  • 17 local bootstrap and subprocess regressions passed;
  • 6 CE desktop payload tests passed;
  • Black, cargo fmt, and git diff --check passed; and
  • a fresh derived CE tree was launched with the installed Windows Python runtime,
    redirected logs, and UTF-8 environment overrides deliberately removed. The
    service reached /health, and the resulting log decoded as UTF-8 with the
    completed default-plugin status present.

@Luhaozhu
Luhaozhu merged commit bea8ef4 into main Jul 23, 2026
3 checks passed
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.

1 participant