From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 15481385B531 for ; Fri, 13 Jan 2023 01:08:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 15481385B531 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673572114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eYfxU3BzS8xq+NgdseWOvimdvVy86o/7nZR/9B4aZ0s=; b=BmGXPCSMUwUtgfinR6lBRCjGTdPAIBKrvfOEOf4Svs6C86mNtOfth/koiAnmtpIc7MMF65 6j5TMMAlUn9FvQd1RdwODq/30p3HmS+R6DH2GQjaX7Hul/tsm0GYkAHxnrhlPRlXZramn9 a5zW1EdSV30HmHrdpde/fZ/spkZ6PMk= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-179-C-suBtAFMSOGJ_5UIzlzqQ-1; Thu, 12 Jan 2023 20:08:33 -0500 X-MC-Unique: C-suBtAFMSOGJ_5UIzlzqQ-1 Received: by mail-lf1-f71.google.com with SMTP id l28-20020ac2555c000000b004cc8e53e69aso3831576lfk.18 for ; Thu, 12 Jan 2023 17:08:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eYfxU3BzS8xq+NgdseWOvimdvVy86o/7nZR/9B4aZ0s=; b=AsQK/W2QYBnmhUtuJe2DaydhtjqMOZarW49J+Nqb91CbxhEkDMlboW5DKqHT/5ADMe kOCArDh7Vgp4t5+YUaKWh8grfNJRKDUhxifhub5GLtwsiWPuKhziXi+tuDDGu7GTNuE8 w7dyOu/l5+fLZ+5uNWf0EQ8H/zz2vqcfevtzCsWFOag4KevXIBf+T/zNt6q3ka+h4T2I RDuNf1FIxeVl38l6KeH9NOcmkL2uxC+4cixAWkCFhd1p7yPKWvCmKgrMrYvMTUrMKokh /RWW+m8m9hjVhHwN+yskqUzW8C7mC1iMYgU3GdQWoBkXwXTeWNWWh8WiNgFr6GzW3ftt ADMA== X-Gm-Message-State: AFqh2kocqBQHZTE7qgJg2JNcrulSZ+ggG6ENQQZ29uFXB6q/r8YahN/2 NfV7M7hnrb4RFBCNoM1tg2tkIDbtVgRx+JUJpGBgPlz2LtbNbiy7H+OhsXimBkg3fCvSuN9dR1O FKNrFUp9VFS5NCOpYu3VpOkgXBHNGHIc= X-Received: by 2002:a05:6512:3772:b0:4b5:aa1c:4d12 with SMTP id z18-20020a056512377200b004b5aa1c4d12mr3737418lft.481.1673572111953; Thu, 12 Jan 2023 17:08:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXtS3lJYtKWtd0FF++XK4rxpeQIefF0L3IKvQu9UgnlTUkZf2irQngyo3dYRylB+QDX1j0kbaMwuMvn4i4Keg6Y= X-Received: by 2002:a05:6512:3772:b0:4b5:aa1c:4d12 with SMTP id z18-20020a056512377200b004b5aa1c4d12mr3737415lft.481.1673572111599; Thu, 12 Jan 2023 17:08:31 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Fri, 13 Jan 2023 01:08:20 +0000 Message-ID: Subject: Re: [PATCH v2] libstdc++: Fix Unicode codecvt and add tests [PR86419] To: Dimitrij Mijoski Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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 List-Id: On Tue, 10 Jan 2023 at 12:59, Dimitrij Mijoski via Libstdc++ wrote: > > Fixes the conversion from UTF-8 to UTF-16 to properly return partial > instead ok. > Fixes the conversion from UTF-16 to UTF-8 to properly return partial > instead ok. > Fixes the conversion from UTF-8 to UCS-2 to properly return partial > instead error. > Fixes the conversion from UTF-8 to UCS-2 to treat 4-byte UTF-8 sequences > as error just by seeing the leading byte. > Fixes UTF-8 decoding for all codecvts so they detect error at the end of > the input range when the last code point is also incomplete. > > libstdc++-v3/ChangeLog: > PR libstdc++/86419 > * src/c++11/codecvt.cc: Fix bugs. > * testsuite/22_locale/codecvt/codecvt_unicode.cc: New tests. > * testsuite/22_locale/codecvt/codecvt_unicode.h: New tests. > * testsuite/22_locale/codecvt/codecvt_unicode_wchar_t.cc: New > tests. I'm just finishing testing and will push this. I had to add to the new codecvt_unicode.h header, and fixed some formatting in codecvt (we don't put a space before function parameter lists in the libstdc++ code, unlike in the code for the GCC compiler itself). I've also made the changelog entry a bit more descriptive. Thanks again for the bug report and for fixing it!