https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86419

--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jonathan Wakely
<r...@gcc.gnu.org>:

https://gcc.gnu.org/g:12c193e5723f08694c8784457200112bae117063

commit r12-10246-g12c193e5723f08694c8784457200112bae117063
Author: Dimitrij Mijoski <dm...@hotmail.com>
Date:   Tue Jan 10 13:58:59 2023 +0100

    libstdc++: Fix Unicode codecvt and add tests [PR86419]

    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 (read_utf8_code_point): Correctly detect
            errors in incomplete multibyte sequences.
            (utf16_in): Remove surrogates parameter. Fix conditions for
            returning partial.
            (utf16_out): Fix condition for returning partial.
            (ucs2_in): Do not pass surrogates argument to utf16_in.
            * testsuite/22_locale/codecvt/codecvt_unicode.cc: New test.
            * testsuite/22_locale/codecvt/codecvt_unicode.h: New header for
            tests.
            * testsuite/22_locale/codecvt/codecvt_unicode_wchar_t.cc: New
            test.

    (cherry picked from commit 02dab998665dda0f6df31740e8897c42de3d740f)
  • [Bug libstdc++/86419] codecvt&l... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to