Skip to content

fix(cli): accept folders and files whose names are not ASCII on Windows - #17

Merged
ShadobaDev merged 2 commits into
mainfrom
fix/cli-non-ascii-paths
Nov 8, 2026
Merged

ShadobaDev merged 2 commits into
mainfrom
fix/cli-non-ascii-paths

Conversation

@ShadobaDev

Copy link
Copy Markdown
Owner

Summary

On Windows, platemaker-cli rejected a folder whose name is not ASCII
(--input "…\Mój katalog" → "is not a directory"), and could not open or
write such files. The CLI built std::filesystem::path from its UTF-8
arguments with the narrow constructor, which MSVC reads in the ANSI code page,
and converted paths back with path::string(). Once the first half was fixed,
the second would have stored ANSI bytes in the workspace JSON.

Every path in cli/main.cpp now goes through utf8ToPath() / pathToUtf8(),
as the library already does:

  • --input of process, project create, project mod;
  • workspace create, workspace import-profiles --from, template;
  • the output folder and stale-output cleanup in process.

The library is unchanged.

Also in this branch: docs/TODO.md drops items that are released or done.

Tests

  • New tests/cli-tests/test_non_ascii_paths.py: one end-to-end walk through
    every command above under folders named with ó (in the ANSI code page)
    and 漫 (outside it). It checks exit codes, the files written, and that the
    workspace stores the paths as UTF-8. It fails on main and passes here.
  • conftest.py decodes the CLI's text output as UTF-8, which is what the CLI
    writes. The ANSI default on Windows garbled it.
  • msvc-debug 393/393, mingw-debug 393/393, linux-debug 429/429.
  • Golden render of the reference pages (60 slices) is byte-identical between
    main and this branch. With the fix, it also renders directly from a
    non-ASCII folder.

🤖 Generated with Claude Code

ShadobaDev and others added 2 commits November 8, 2026 00:58
The CLI built std::filesystem paths from its UTF-8 arguments with the narrow
constructor, which MSVC reads in the ANSI code page, and wrote them back with
path::string(). A non-ASCII folder was rejected, and once found its paths
would have been stored in the workspace as ANSI bytes. Every path now crosses
through utf8ToPath() / pathToUtf8(), as in the library.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ShadobaDev
ShadobaDev merged commit fd36871 into main Nov 8, 2026
4 checks passed
@ShadobaDev
ShadobaDev deleted the fix/cli-non-ascii-paths branch November 8, 2026 00:37
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