When using std::filesystem::path under Cygwin or Non-Windows with
wide-character strings,
there was an implicit conversion to/from ASCII, leading to errors when
dealing with Unicode filenames.

The attached patch fixes this behavior by using the correct
transformations to the internal representation
(from/to UTF16 for Cygwin, UTF32 for other non-Windows systems).

libstdc++-v3/ChangeLog:

* include/bits/fs_path.h: fixed Cygwin+Unix wide character handling
* testsuite/27_io/filesystem/path/construct/90281.cc: Moved to...
* testsuite/27_io/filesystem/path/construct/unicode_paths.cc: ...here.
added testcase
* testsuite/27_io/filesystem/path/native/string.cc: added testcase for
wide character output


Some notes:

I found the documentation on submissions in some respects unclear and
confusing, so please
correct me if I did something wrong. I assume that you also need a
copyright transfer from my company?
The definition of "small change" and the process for the copyright
transfer is one of the unclear issues.

Also, I did not fix the case of __GNUC_WIDE_EXECUTION_CHARSET_NAME
that is mentioned in the bug
discussion. This should be even more exotic, and is well outside my
current skill level and allotted time
budget.

Also, this being my only patch for the foreseeable future, I have not
subscribed to the mailing list.


Regards,
Ulf Lorenz

<<attachment: patch.zip>>

Reply via email to