diff --git a/include/boost/archive/detail/utf8_codecvt_facet.hpp b/include/boost/archive/detail/utf8_codecvt_facet.hpp index 9faba38e..5956feb5 100644 --- a/include/boost/archive/detail/utf8_codecvt_facet.hpp +++ b/include/boost/archive/detail/utf8_codecvt_facet.hpp @@ -9,7 +9,8 @@ #include -#ifdef BOOST_NO_CXX11_HDR_CODECVT +//#ifdef BOOST_NO_CXX11_HDR_CODECVT +#if 1 #include #define BOOST_UTF8_BEGIN_NAMESPACE \ namespace boost { namespace archive { namespace detail { diff --git a/include/boost/archive/iterators/wchar_from_mb.hpp b/include/boost/archive/iterators/wchar_from_mb.hpp index dbeb8f69..2fc8b52a 100644 --- a/include/boost/archive/iterators/wchar_from_mb.hpp +++ b/include/boost/archive/iterators/wchar_from_mb.hpp @@ -143,15 +143,16 @@ template void wchar_from_mb::drain(){ BOOST_ASSERT(! m_input.m_done); for(;;){ - typename boost::iterators::iterator_reference::type c = *(this->base_reference()++); - * const_cast::type *>( - (m_input.m_next_available++) - ) = c; + typename boost::iterators::iterator_reference::type c = *(this->base_reference()); // a null character in a multibyte stream is takes as end of string if(0 == c){ m_input.m_done = true; break; } + ++(this->base_reference()); + * const_cast::type *>( + (m_input.m_next_available++) + ) = c; // if input buffer is full - we're done for now if(m_input.m_buffer.end() == m_input.m_next_available) break; diff --git a/src/utf8_codecvt_facet.cpp b/src/utf8_codecvt_facet.cpp index c8a3e36f..c0a64f29 100644 --- a/src/utf8_codecvt_facet.cpp +++ b/src/utf8_codecvt_facet.cpp @@ -7,7 +7,8 @@ #ifdef BOOST_NO_STD_WSTREAMBUF #error "wide char i/o not supported on this platform" #else - #ifdef BOOST_NO_CXX11_HDR_CODECVT +// #ifdef BOOST_NO_CXX11_HDR_CODECVT + #if 1 # define BOOST_ARCHIVE_SOURCE #include #define BOOST_UTF8_BEGIN_NAMESPACE \ diff --git a/test/test_iterators.cpp b/test/test_iterators.cpp index 01b6153e..ad63eb37 100644 --- a/test/test_iterators.cpp +++ b/test/test_iterators.cpp @@ -73,6 +73,7 @@ void test_roundtrip(const wchar_t * la){ translator(la + s), std::back_inserter(a) ); + a.push_back((char)0); } BOOST_CHECK(a.size() > 0); std::vector la2; @@ -83,8 +84,9 @@ void test_roundtrip(const wchar_t * la){ translator(a.end()), std::back_inserter(la2) ); + la2.push_back((wchar_t)0); } - BOOST_CHECK(la2.size() == s); + BOOST_CHECK(la2.size() == s + 1); BOOST_CHECK(std::equal(la, la + s, la2.begin())); } #endif