Skip to content

Gate windows-sys dependencies on Windows targets and fix UTF-8 terminal output#45

Open
subhramit wants to merge 3 commits into
EpicGames:mainfrom
subhramit:windows-sys-platform-gate
Open

Gate windows-sys dependencies on Windows targets and fix UTF-8 terminal output#45
subhramit wants to merge 3 commits into
EpicGames:mainfrom
subhramit:windows-sys-platform-gate

Conversation

@subhramit

@subhramit subhramit commented Jun 20, 2026

Copy link
Copy Markdown

Part of cross-platform build portability.

Fixes #43
Fixes #30

  1. Four crates listed windows-sys under [dependencies] instead of [target.'cfg(target_family = "windows")'.dependencies], causing build failures on non-x86_64 Linux architectures. This moves them under the right (Windows) targets.
  2. The Windows console also defaulted to a legacy codepage on many configurations, causing non-ASCII characters to display as mojibake in pager-backed commands like lore history. So to fix that, this also adds a SetConsoleOutputCP(CP_UTF8) call at the CLI startup.

Four crates listed `windows-sys` under `[dependencies]`, causing build failures on non-x86_64 Linux architectures. Move them under `[target.'cfg(target_family = "windows")'.dependencies]`.

Fixes EpicGames#43

Signed-off-by: subhramit <subhramit.bb@live.in>

@mjansson mjansson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, looks good

@subhramit subhramit changed the title Move windows-sys dependency under Windows targets Move windows-sys dependencies under Windows targets Jun 24, 2026
`lore history` and other pager-backed commands produced mojibake for non-ASCII characters on Windows because the console codepage defaulted to a legacy encoding. Call `SetConsoleOutputCP(CP_UTF8)` at CLI startup under `#[cfg(target_family = "windows")]` so all output, including pager-spawned subprocesses, uses UTF-8 from the start.

Fixes EpicGames#30

Signed-off-by: subhramit <subhramit.bb@live.in>
@subhramit subhramit changed the title Move windows-sys dependencies under Windows targets Gate windows-sys on Windows targets and fix UTF-8 terminal output Jun 27, 2026
@subhramit subhramit requested a review from mjansson June 27, 2026 21:25
@subhramit

subhramit commented Jun 27, 2026

Copy link
Copy Markdown
Author

Extended scope of the PR due to #77 (comment).
Let me know if the commits need to be squashed into one with a combined commit message instead of individual ones.

@subhramit subhramit changed the title Gate windows-sys on Windows targets and fix UTF-8 terminal output Gate windows-sys dependencies on Windows targets and fix UTF-8 terminal output Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants