From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D344739F7C9C; Thu, 12 Nov 2020 13:58:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D344739F7C9C From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/95048] [9/10/11 Regression] wstring-constructor of std::filesystem::path throws for non-ASCII characters Date: Thu, 12 Nov 2020 13:58:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2020 13:58:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95048 --- Comment #7 from Jonathan Wakely --- (In reply to Christian Fersch from comment #6) > It seems like the solution would be to use codecvt_utf8 if wchar_t is 32b= it > and codecvt_utf8_utf16 if wchar_t is 16bit. This also seems to be what > libc++ is doing. Would you accept a patch for this? Doesn't this have the problem I pointed out in comment 5? Using codecvt_utf8 assumes that the wchar_t encoding is either UCS-2 or UCS-4. GCC supports changing that encoding using the -fwide-exec-charset=3D option. > Do we need to handle systems where wchar_t is something other than 16 or = 32 > bit wide? No.=