From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15990 invoked from network); 1 Nov 2020 20:25:50 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 1 Nov 2020 20:25:50 -0000 Received: (qmail 12272 invoked by uid 550); 1 Nov 2020 20:25:47 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 12254 invoked from network); 1 Nov 2020 20:25:47 -0000 X-Virus-Scanned: Debian amavisd-new at disroot.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1604262334; bh=SYgS6P+OgZIxll6M7dUdNkUv+4r1VVv0UyNlF2g6qS0=; h=Subject:From:To:Date:In-Reply-To; b=SLn5vZnM4KnGyIlL772KE5n4iPPOtsC+ak4iPUyNhFjjh6XY8EweZVlrFyJ9hwAWW ay2fr4LZ36QV4ZiHUEo42/ZZYh0rI2vDUistbrLcr2b+zqWfN4ZfZBg8ale1zTR7k+ +p1Wdag24rTD63iZCaW9Hba4KmKbDSDDPwyCGTauMQHNTkrDxPRGyLz4jxOh++zFEZ 2HC6jrJJ/2p6NdPHVBtXO63X2ncm2e9VuOnOSsXA/tecfKAnA/Hb9u/OS/GO8mPplT HbTueaNJuuWzQwPRbHBME7IPzd0gpZ/NC9v14JUO6x9KP6G8dIs+yfUao0//PmvrKk xnQdmT1XjGNig== Content-Type: text/plain; charset=UTF-8 From: =?utf-8?q?=C3=89rico_Nogueira?= To: , Date: Sun, 01 Nov 2020 17:17:49 -0300 Message-Id: In-Reply-To: <1597340845.300326000.m2kng81l@frv50.fwdcdn.com> Subject: Re: [musl] swprintf possible bug On Sun Nov 1, 2020 at 6:06 PM -03, Alexander Vitiuk wrote: > Hello! > It seems, wsprintf() / wprintf() are not working in musl as expected, if > uses with cyrillic: > > C testcase: > #include > int main() { > wprintf(L"[hello]\n"); > wprintf(L"[=D0=9F=D1=80=D0=B8=D0=B2=D0=B5=D1=82]\n"); > return 0; > } > on x86_64-linux-gnu prints: > [hello] > [Privet] > and on x86_64-linux-musl prints: [hello] > [ > > There are other cases described: > https://github.com/emscripten-core/emscripten/issues/11947 For what it's worth, if this is a bug, it would seem to be in how musl decides when to print characters (not the formatting functions themselves), since the below program doesn't print anything: #include #include int main() { fputws(L"[=D0=9F=D1=80=D0=B8=D0=B2=D0=B5=D1=82 =D0=92=D0=B0=D1=81=D0=B8= =D0=BB=D0=B8=D0=B9]\n", stdout); // I don't know if I'm accessing a wchar_t appropriately here fputwc(L"[=D0=9F=D1=80=D0=B8=D0=B2=D0=B5=D1=82 =D0=92=D0=B0=D1=81=D0=B8= =D0=BB=D0=B8=D0=B9]\n"[3], stdout); return 0; } I tried tracing the execution from fputws, and not printing anything seems to be caused by the return value of wcsrtombs(). Hope this helps, =C3=89rico