DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 44NLWSeF2990640 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=ikMy1bOz X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EDAEE3865C30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1716499946; bh=5i+Rfr7mx30qgT9D+o8sBCkpGCkpODFkIRPfzpD5Ji4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ikMy1bOzLzMn9J1exN7U7bpEui3Ri3zb/Y4bm3NlY3ks8M7lNP8k9aMiSO4AOjopf bEscsD8iTXJLCJHQ+hurPthwIMHDhEI6dyB3LRWMjoPT8m0BhKyc8hu17f9Pc093aI TF7n5T/k0TzaaUWR27jwkg2SjGRVgkCzxTDDHHBg= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BC6053858CD1 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BC6053858CD1 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1716499873; cv=pass; b=iU+8GNRypDJC8JEwnmaxll66lWWxfAO1Cop021GyjTDiUHM2EJkD5TXrjS3vslYpXXqfZ98sR+jY5ekwEvIX4uJvx12APz3M0yUsaqcxzBN8wkqtEn3O2Ry0pUwLMRrG4y5dR3UYgV/3piyoOPYLf5Elk5YTqNaRhky6Fanfrp8= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1716499873; c=relaxed/simple; bh=9AJF9hEpqWIQI0bZlC+qta9kGaoVVz22j9tecrrekVg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=uj+LhsEWMJ2oCn7bGER8JEyXe5KGR6Bmv8DFAujO+xkGPGKCMv2+Exg5ZwY55zpydWw2G0uEHoLMaZeqFzjdnSQXk52akFVKsnmNHVcGXKAuGxMt94ewzENwPaPENMhGemflFfbXTiBPTfewOC81EU3XHaC5hGgu8WlUAefz8C8= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; t=1716499868; cv=none; d=strato.com; s=strato-dkim-0002; b=QV7AVQITTgb/gImb+A+DcmtmV8O4TLMvNlnWJN28g8N8iBkndTwvLz6K9T0JcmCVr/ PyUKGW9LwMcJU3pBM2tJPB7yUxagXkdmbQ0vakF6fN+zQUZ1o/sm+pdIPlQcU4vFmzxM HGP3aCPyJWBGtVoecxXLrGs7PJPgiwNtSHjcX8/sA1V/SPgnyKuKubthRH+TBOro4MFV I6FVE/F0H6mIhb0ULZuM7EP/s3Pu2sKZoHTANpwatqoV2CvDbTxpKOWwcy+sWnYfb+Sm OWMhOtk/Vdmlx6mNegMWd6knqhOXPnR7lVFDG1sO8B4RDDNtpKOSJh49Na9mNNCXFct0 5ysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1716499868; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=PD+ms9agC9ZeFsAsGj0GNbBXJneOMmdCICsB/8G2AlY=; b=lmJpRJfRtgFvn4BYwlxY0BsfoNfHFZIXufn7vzRj9yfLtkHtHAaGA3joz0f0e17nA7 fmB6GRFOaE7y3uz9WcoU8QTi0xGgQWUC+xGjaJvIOH7oVc49amadqgpv3E8klH+HR+7L 2zZVtp9iOiTdRTsMMrMoxlW0EfcfCKysPSArY34vE92rBmDO+800JD84CjTjb6j4Eyey Eps3yIiw5ogbaqGMaX3m+R4wyBJ8yMxCuEf+f/GUTAyxjV5Q9pXJ6/yk49NGJgOIi1Mq zmBZO98ipJXklijfj7Qrlb3CPvnfNZj2ZKRvt1R01C/uz8r9R9cF/Offg0iGSIOCW3h/ SjOQ== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpOX3P149LkVf20eFCaVg/pP5Ck=" To: cygwin AT cygwin DOT com Subject: Re: an mbrtoc32 bug Date: Thu, 23 May 2024 23:31:07 +0200 Message-ID: <4567474.PpUMLH0tvb@nimes> In-Reply-To: <6004047.n2Wp99KBFH@nimes> References: <6004047 DOT n2Wp99KBFH AT nimes> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart2744327.tvv3v5Dze1" Content-Transfer-Encoding: 7Bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Bruno Haible via Cygwin Reply-To: Bruno Haible Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" This is a multi-part message in MIME format. --nextPart2744327.tvv3v5Dze1 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" The test case that I sent uses UTF-8 encoding. Here's another test case, that uses GB18030 (supposedly supported since Cygwin 3.5.0). It fails as well, in line 26. On glibc systems, this test works. --nextPart2744327.tvv3v5Dze1 Content-Disposition: attachment; filename="foo.c" Content-Transfer-Encoding: 7Bit Content-Type: text/x-csrc; charset="UTF-8"; name="foo.c" #include #include #include #include #include #include #include int main () { assert (setlocale (LC_ALL, "zh_CN.GB18030") != NULL); mbstate_t state; memset (&state, 0, sizeof (state)); char32_t uc = 0xDEADBEEF; size_t bytes; /* \224\071\311\067 = U+0001F403 */ bytes = mbrtoc32 (&uc, "\224", 1, &state); assert (bytes == (size_t)-2); bytes = mbrtoc32 (&uc, "\071", 1, &state); assert (bytes == (size_t)-2); bytes = mbrtoc32 (&uc, "\311", 1, &state); assert (bytes == (size_t)-2); bytes = mbrtoc32 (&uc, "\067", 1, &state); assert (bytes == 1); assert (uc == 0x0001F403); } /* Works in: glibc Fails in: Cygwin 3.5.3 */ --nextPart2744327.tvv3v5Dze1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple --nextPart2744327.tvv3v5Dze1--