-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling of unicode arguments on windows (#5)
This commit tweaks the `as.exe` tool to handle passing of file paths containing non ascii characters. This is done in the following steps: - on windows, we don't use the `argc` and `argv` from main, since they only support ascii (unlike on linux where they contain utf8 directly). We use instead the windows api `CommandLineToArgvW` to get the arguments in utf16 and then convert it to utf8. - when parsing the arguments and creating `std::filesystem::path`, we cast the `optarg` char* to the C++20 type char8_t* so the path constructor knows the string is in utf8 encoding. - when creating the process, we convert the args from u8 to utf16 and use the wide char version of `CreateProcess`
- Loading branch information
Showing
6 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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