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 <jwak...@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