Commit a1e1ec76 by Jonathan Wakely Committed by Jonathan Wakely

Fix std::codecvt_utf8* for big-endian targets

	PR libstdc++/69703
	* src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in,
	__codecvt_utf8_utf16_base<char16_t>::do_in): Fix mask operations.

From-SVN: r235293
parent 1011119f
2016-04-20 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/69703
* src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in,
__codecvt_utf8_utf16_base<char16_t>::do_in): Fix mask operations.
2016-04-19 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/69703
* src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in)):
* src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in):
Override endianness bit in mode.
* testsuite/22_locale/codecvt/codecvt_utf8/69703.cc: New test.
* testsuite/22_locale/codecvt/codecvt_utf8_utf16/66855.cc: Test
......
......@@ -789,7 +789,7 @@ do_in(state_type&, const extern_type* __from, const extern_type* __from_end,
{
range<const char> from{ __from, __from_end };
range<char16_t> to{ __to, __to_end };
codecvt_mode mode = codecvt_mode(_M_mode | (consume_header|generate_header));
codecvt_mode mode = codecvt_mode(_M_mode & (consume_header|generate_header));
#if __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__
mode = codecvt_mode(mode | little_endian);
#endif
......@@ -1268,7 +1268,7 @@ do_in(state_type&, const extern_type* __from, const extern_type* __from_end,
{
range<const char> from{ __from, __from_end };
range<char16_t> to{ __to, __to_end };
codecvt_mode mode = codecvt_mode(_M_mode | (consume_header|generate_header));
codecvt_mode mode = codecvt_mode(_M_mode & (consume_header|generate_header));
#if __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__
mode = codecvt_mode(mode | little_endian);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment