This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix codecvt<char16_t, char, mbstate_t>
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 18 Feb 2015 20:22:58 +0100
- Subject: Re: [patch] Fix codecvt<char16_t, char, mbstate_t>
- Authentication-results: sourceware.org; auth=none
- References: <20150218190705 dot GJ3360 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Feb 18, 2015 at 07:07:05PM +0000, Jonathan Wakely wrote:
> While working on PR64797 I discovered that the codecvt<char16_t,...>
> specialization was, erm, completely broken when creating UTF-16
> surrogate pairs.
>
> This fixes it and adds a test, based on the char32_t one I added to
> the testsuite yesterday. Tested x86_64-linux (little-endian) and
> powerpc64-linux (big-endian).
Ok for trunk from RM POV, thanks.
> commit c0a8047982d0911f74647dba43d65f3b14113f1c
> Author: Jonathan Wakely <jwakely@redhat.com>
> Date: Wed Feb 18 11:49:11 2015 +0000
>
> * src/c++11/codecvt.cc (write_utf16_code_point): Fix code to output
> surrogate pairs.
> (utf16_in): Pass mode argument to write_utf16_code_point.
> (codecvt<char16_t, char, mbstate_t>::do_in): Set mode according to
> native byte order.
> * testsuite/22_locale/codecvt/char16_t.cc: New.
> * testsuite/22_locale/codecvt/in/wchar_t/1.cc: Fix typo.
Jakub