public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kontakt at neonfoto dot de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/95048] New: wstring-constructor of std::filesystem::path throws for non-ASCII characters Date: Mon, 11 May 2020 07:59:09 +0000 [thread overview] Message-ID: <bug-95048-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95048 Bug ID: 95048 Summary: wstring-constructor of std::filesystem::path throws for non-ASCII characters Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: kontakt at neonfoto dot de Target Milestone: --- When trying to port our Windows application to Linux, I encountered a problem constructing an instance of std::filesystem::path with a wide-character literal containing a non-ASCII wchar: #include <filesystem> int main() { std::filesystem::path p = L"ä"; } This builds fine with g++-10 -Wall -Wextra -pedantic -std=c++17 minimal.cpp on my Ubuntu 18.04 in WSL (using g++ from this ppa: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test) but throws an exception on execution: terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error' what(): filesystem error: Cannot convert character sequence: Invalid or incomplete multibyte or wide character Reading the C++ standard, I believe this should not happen and libstdc++ should be able to convert the wchar literal to a path. Using clang with libc++ instead of libstdc++ performs a conversion as I expected. Trying different versions of g++ in the Compiler Explorer (https://godbolt.org/z/KQD1I6) shows that this also used to work with g++9.1 and stopped working in g++9.2. The problem was already described by someone else in this StackOverflow post: https://stackoverflow.com/questions/58521857/cross-platform-way-to-handle-stdstring-stdwstring-with-stdfilesystempath
next reply other threads:[~2020-05-11 7:59 UTC|newest] Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-11 7:59 kontakt at neonfoto dot de [this message] 2020-05-11 20:49 ` [Bug libstdc++/95048] " redi at gcc dot gnu.org 2020-05-11 20:59 ` carlos at redhat dot com 2020-05-11 21:14 ` [Bug libstdc++/95048] [9/10/11 Regression] " redi at gcc dot gnu.org 2020-05-11 21:19 ` redi at gcc dot gnu.org 2020-05-11 21:25 ` redi at gcc dot gnu.org 2020-06-26 12:05 ` rguenth at gcc dot gnu.org 2020-11-12 13:48 ` gcc-bugzilla at m dot chronial.de 2020-11-12 13:58 ` redi at gcc dot gnu.org 2020-11-12 14:02 ` redi at gcc dot gnu.org 2020-11-12 23:49 ` gcc-bugzilla at m dot chronial.de 2021-01-14 8:44 ` rguenth at gcc dot gnu.org 2021-04-19 10:40 ` redi at gcc dot gnu.org 2021-06-01 8:17 ` [Bug libstdc++/95048] [9/10/11/12 " rguenth at gcc dot gnu.org 2021-07-23 12:40 ` gcc-bugzilla at m dot chronial.de 2021-10-19 13:25 ` redi at gcc dot gnu.org 2022-05-27 9:42 ` [Bug libstdc++/95048] [10/11/12/13 " rguenth at gcc dot gnu.org 2022-06-28 10:40 ` jakub at gcc dot gnu.org 2022-10-24 15:09 ` ulf.lorenz at ptvgroup dot com 2022-10-25 11:54 ` redi at gcc dot gnu.org 2022-10-25 12:47 ` ulf.lorenz at ptvgroup dot com 2022-11-11 17:43 ` cvs-commit at gcc dot gnu.org 2022-11-11 17:46 ` [Bug libstdc++/95048] [10/11/12 " redi at gcc dot gnu.org 2022-11-11 17:51 ` redi at gcc dot gnu.org 2022-11-11 22:29 ` cvs-commit at gcc dot gnu.org 2022-11-14 18:34 ` cvs-commit at gcc dot gnu.org 2022-11-22 11:51 ` [Bug libstdc++/95048] [10/11 " ulf.lorenz at ptvgroup dot com 2022-11-22 12:30 ` redi at gcc dot gnu.org 2023-07-07 10:37 ` [Bug libstdc++/95048] [11 " rguenth at gcc dot gnu.org 2023-07-10 15:47 ` cvs-commit at gcc dot gnu.org 2023-07-12 20:04 ` cvs-commit at gcc dot gnu.org 2023-07-12 20:16 ` cvs-commit at gcc dot gnu.org 2023-07-12 20:19 ` cvs-commit at gcc dot gnu.org 2023-07-12 20:23 ` cvs-commit at gcc dot gnu.org 2023-07-12 20:24 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-95048-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).