--- code_converter.hpp.orig Sat Mar 22 22:45:55 2008 +++ code_converter.hpp Wed Jul 9 14:02:46 2008 @@ -331,8 +346,10 @@ case std::codecvt_base::noconv: { std::streamsize amt = - std::min(next - buf.ptr(), n - total); + std::min(buf.eptr() - buf.ptr(), + n - total); detail::strncpy_if_same(s + total, buf.ptr(), amt); + buf.ptr() += amt; total += amt; } break; @@ -383,9 +400,10 @@ case std::codecvt_base::noconv: { std::streamsize amt = - std::min( nint - total - s, - buf.end() - buf.eptr() ); + std::min(n - total, + buf.end() - buf.eptr()); detail::strncpy_if_same(buf.eptr(), s + total, amt); + buf.eptr() += amt; total += amt; } break; --- detail/codecvt_holder.hpp.orig Sat Mar 22 22:45:55 2008 +++ detail/codecvt_holder.hpp Wed Jul 9 15:06:19 2008 @@ -21,8 +21,8 @@ namespace boost { namespace iostreams { namespace detail { -struct default_codecvt { - typedef wchar_t intern_type, from_type; +template struct basic_default_codecvt { + typedef C intern_type, from_type; typedef char extern_type, to_type; typedef std::mbstate_t state_type; }; @@ -35,9 +35,9 @@ Codecvt codecvt_; }; -template<> -struct codecvt_holder { - typedef std::codecvt codecvt_type; +template +struct codecvt_holder > { + typedef std::codecvt codecvt_type; codecvt_holder() { reset_codecvt(); } const codecvt_type& get() const { return *codecvt_; } void imbue(const std::locale& loc) @@ -57,6 +57,8 @@ std::locale loc_; // Prevent codecvt_ from being freed. const codecvt_type* codecvt_; }; + +typedef basic_default_codecvt default_codecvt; } } } // End namespaces detail, iostreams, boost.