https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79511
--- Comment #15 from Jonathan Wakely <redi at gcc dot gnu.org> --- Author: redi Date: Thu Mar 16 15:27:45 2017 New Revision: 246199 URL: https://gcc.gnu.org/viewcvs?rev=246199&root=gcc&view=rev Log: PR libstdc++/79511 fix endianness of UTF-16 data PR libstdc++/79511 * src/c++11/codecvt.cc (write_utf16_code_point): Don't write 0xffff as a surrogate pair. (__codecvt_utf8_utf16_base<char32_t>::do_in): Use native endianness for internal representation. (__codecvt_utf8_utf16_base<wchar_t>::do_in): Likewise. * testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc: New test. Added: trunk/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/src/c++11/codecvt.cc