From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F08B6386F839; Mon, 11 May 2020 20:49:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F08B6386F839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589230171; bh=p+TDKv/XYihxu6D3iUGDoyVhNg/u2eTs5rJii14vZXU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dpeSpG4d/4P9w0R2wbvRpD0W4Hcg+xGAKpRy7crEgdpTBvilgvTjyrwZZMHkT6Pty XbQwinAMnSzf2FJkmvcV1n9OLr0YclhxUq4mhQZBzZyqjCKzMHgddVWqmXWFRu2OSe 0Lco9Q3ugGcPFSLj/Abr9SSgWiZ0HwoWQbILcy0E= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/95048] wstring-constructor of std::filesystem::path throws for non-ASCII characters Date: Mon, 11 May 2020 20:49:31 +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: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed bug_status cf_reconfirmed_on 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: Mon, 11 May 2020 20:49:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95048 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2020-05-11 --- Comment #1 from Jonathan Wakely --- This happens because glibc won't convert the wide string to UTF-8: #include #include int main() { const wchar_t wstr[] =3D L"=C3=A4"; const wchar_t* from =3D wstr; char to[10]; mbstate_t s; size_t res =3D wcsnrtombs(to, &from, 1, sizeof(to), &s); assert(res !=3D (size_t)-1); } I'm not yet sure why glibc refuses to convert that.=