Added support for UTF-8 strings into windows part of the code:
cmake project now has an option OPTION_WINDOWS_UTF8 default ON to enable this feature, if set to OFF then everything works as before my changes
all windows file system functions use the ansi or unicode variant based on the above option, if unicode mode is used then the strings sent to the Windows API calls are assumed to be UTF-8 encoded and converted to Windows native unicode format
This effectively allows ( with proper source code file encoding ) for this piece of code to work properly:
int main(int argc, char* argv[]) {
auto file = cppfs::fs::open("D:\\testá.file");
printf("File exists: %s\n", file.exists() ? "YES" : "NO");
printf("DONE\n");
}
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
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.
Added support for UTF-8 strings into windows part of the code:
This effectively allows ( with proper source code file encoding ) for this piece of code to work properly:
int main(int argc, char* argv[]) { auto file = cppfs::fs::open("D:\\testá.file"); printf("File exists: %s\n", file.exists() ? "YES" : "NO"); printf("DONE\n"); }it outputs:
Tested on:
With latest Visual Studio.