Repository navigation
fix(cli): accept folders and files whose names are not ASCII on Windows - #17
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows,
platemaker-clirejected a folder whose name is not ASCII(
--input "…\Mój katalog"→ "is not a directory"), and could not open orwrite such files. The CLI built
std::filesystem::pathfrom its UTF-8arguments 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.cppnow goes throughutf8ToPath()/pathToUtf8(),as the library already does:
--inputofprocess,project create,project mod;workspace create,workspace import-profiles --from,template;process.The library is unchanged.
Also in this branch:
docs/TODO.mddrops items that are released or done.Tests
tests/cli-tests/test_non_ascii_paths.py: one end-to-end walk throughevery command above under folders named with
ó(in the ANSI code page)and
漫(outside it). It checks exit codes, the files written, and that theworkspace stores the paths as UTF-8. It fails on
mainand passes here.conftest.pydecodes the CLI's text output as UTF-8, which is what the CLIwrites. The ANSI default on Windows garbled it.
msvc-debug393/393,mingw-debug393/393,linux-debug429/429.mainand this branch. With the fix, it also renders directly from anon-ASCII folder.
🤖 Generated with Claude Code