Skip to content

Correctly handle Unicode paths on Windows#54

Open
polter-rnd wants to merge 1 commit intojimporter:masterfrom
polter-rnd:fix-windows-unicode
Open

Correctly handle Unicode paths on Windows#54
polter-rnd wants to merge 1 commit intojimporter:masterfrom
polter-rnd:fix-windows-unicode

Conversation

@polter-rnd
Copy link
Contributor

@polter-rnd polter-rnd commented Jul 31, 2025

Currently on Windows it's not possible to run tests using either mettle.exe or subprocess test runner if the path contains unicode characters.

It happens because CreateProcessA and GetModuleFileNameA are not Unicode-aware.

The right way is to use generic function prototypes and let the preprocessor choose -A or -W function version depending on the UNICODE definition as described here.

Also added UNICODE definition by default to build.bfg on Windows platform.

Fixes #55

Signed-off-by: Pavel Artsishevsky <polter.rnd@gmail.com>
@polter-rnd polter-rnd force-pushed the fix-windows-unicode branch from 7f2297e to 3d8a743 Compare August 12, 2025 13:02
@jimporter
Copy link
Owner

jimporter commented Sep 22, 2025

Thanks for noticing this (and sorry about the delays in responding). I think we'll need somewhat more extensive changes here though for everything to work nicely. For one thing, it would probably help to switch from std::string to std::filesystem::path where possible. That should keep us from having to use TCHAR in many places. I'll start working on that now.

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.

Cannot run tests if directory path contains Unicode characters

2 participants