Repository navigation
CI: one workflow, fewer macOS jobs, more code pages; Windows path separators, conversion state - #205
Merged
Conversation
…character On Windows, Path_Get(), Name_Get(), Extension_Get(), the setters and the directory listing accept "/", which Windows accepts as path separator, in addition to "\". FileName_PathSeparator is kept for the programs which use it, but ZenLib does not use it anymore. Without Unicode on Windows, names are in the code page of the system, and with a double-byte one such as cp932, the second byte of some characters is "\", e.g. 0x95 0x5C for U+8868: these functions took it as the last path separator.
From_Local() and To_Local() used the internal state of the C library, which is undefined after a string which is not valid in the encoding of the locale. Some implementations then keep its last bytes, e.g. GB18030 on FreeBSD and macOS: all the next strings, even ASCII ones, gave an empty string, and the listing of a directory with such a name was empty.
The file name checks are in the Checks workflow: one macOS job builds with and without Unicode, with the autotools and CMake, and the Linux, Alpine and FreeBSD jobs cover both modes too. A new push cancels the run of the previous one on the same branch or pull request, except on master. The test program checks the conversions with the GB18030 locale, and with any locale or code page which is neither ASCII nor UTF-8 against the C library or the system, with two Japanese names. On Windows, it runs with the code page of the system, and with UTF-8 and cp932 set by the manifest of the program; without Unicode with cp932, it checks a name whose second byte is "\". It also checks the path separators of the FileName functions.
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.
One workflow for the checks, fewer jobs (1 macOS job instead of 6), more code pages, and the fixes found with them.
CI:
Fixes: