From patchwork Sat Jan 8 00:39:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Honermann X-Patchwork-Id: 49741 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 055D73857C77 for ; Sat, 8 Jan 2022 00:39:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 055D73857C77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1641602368; bh=B/0WIGvrrq94Ydwfg85cG8haY6U0Bn2q/5kBO+rpKkI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=NO/0Z/jfZYxzxCPiaQ7CVZ1mZor65FHTpGgOt053NjZkABdSm9Sxmmnvxn3+9Jr92 bPi6/VO4keeoOqzYU0UFO2M7NjEeZ69OJZWdzSkGC36wJ+UdTWJSfobmZ8SfiYnxNQ t+EOR/pUOFfaQWMqsrYIZmlSRHjfmgWJOUn94X8w= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp66.ord1c.emailsrvr.com (smtp66.ord1c.emailsrvr.com [108.166.43.66]) by sourceware.org (Postfix) with ESMTPS id 46EE03858D28 for ; Sat, 8 Jan 2022 00:39:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 46EE03858D28 X-Auth-ID: tom@honermann.net Received: by smtp1.relay.ord1c.emailsrvr.com (Authenticated sender: tom-AT-honermann.net) with ESMTPSA id BF14320115 for ; Fri, 7 Jan 2022 19:39:03 -0500 (EST) To: libc-alpha Subject: [PATCH 0/3]: C++20 P0482R6 and C2X N2653: support for char8_t, mbrtoc8(), and c8rtomb(). Message-ID: Date: Fri, 7 Jan 2022 19:39:03 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 Content-Language: en-US X-Classification-ID: ee45b8c3-fba9-45dd-ae58-4347a6ebe498-1-1 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom Honermann via Libc-alpha From: Tom Honermann Reply-To: Tom Honermann Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This series of patches provides the following: - A fix for bug 25744 [1]. - Implementations of the mbrtoc8 and c8rtomb functions adopted for C++20 via WG21 P0482R6 [2] and proposed for C2X in WG14 N2653 [3]. - A char8_t typedef as proposed for C2X in WG14 N2653 [3]. These patches addresses feedback provided in response to a previous submission [4][5]. Patch 1: A fix and test for bug 25744 [1]. Patch 2: Definitions of the mbrtoc8 and c8rtomb functions and the char8_t typedef. Patch 3: Tests for the mbrtoc8 and c8rtomb functions and the char8_t typedef. The fix for bug 25744 [1] is included in this patch series because the tests for mbrtoc8 and c8rtomb depend on it for exercising the special case where a pair of Unicode code points is converted to/from a single double byte sequence. Such conversion cases exist for Big5-HKSCS. Since N2653 has not yet been adopted by WG14 for C2x, the new declarations are only present for C when _GNU_SOURCE is defined. If WG14 adopts the proposal for C2x, additional changes will be needed to enable the changes for C2x. Tom. [1]: Bug 25744 "mbrtowc with Big5-HKSCS returns 2 instead of 1 when consuming the second byte of certain double byte characters" https://sourceware.org/bugzilla/show_bug.cgi?id=25744 [2]: WG21 P0482R6 "char8_t: A type for UTF-8 characters and strings (Revision 6)" https://wg21.link/p0482r6 [3]: WG14 N2653 "char8_t: A type for UTF-8 characters and strings (Revision 1)" http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2653.htm [4]: "[PATCH 2/3]: C++20 P0482R6 and C2X N2653: Implement mbrtoc8, c8rtomb, char8_t" https://sourceware.org/pipermail/libc-alpha/2021-June/127232.html [5]: "[PATCH 3/3]: C++20 P0482R6 and C2X N2653: Tests for mbrtoc8, c8rtomb, char8_t" https://sourceware.org/pipermail/libc-alpha/2021-June/127233.html