diff options
author | Dimitrij Mijoski <dmjpp@hotmail.com> | 2023-01-10 13:58:59 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2023-01-13 13:34:20 +0000 |
commit | 02dab998665dda0f6df31740e8897c42de3d740f (patch) | |
tree | 54183d7eb0819f3f09d06817991c223717deac8b /gcc | |
parent | e2fc12a5dafadf15d804e1d2541528296e97a847 (diff) | |
download | gcc-02dab998665dda0f6df31740e8897c42de3d740f.zip gcc-02dab998665dda0f6df31740e8897c42de3d740f.tar.gz gcc-02dab998665dda0f6df31740e8897c42de3d740f.tar.bz2 |
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.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions