const char_type* __iend;
__res_type __r = __cvt.out(_M_state_cur, __ibuf, __ibuf + __ilen,
__iend, __buf, __buf + __blen, __bend);
- // Result == ok, partial, noconv
- if (__r != codecvt_base::error)
+
+ if (__r == codecvt_base::ok || __r == codecvt_base::partial)
__blen = __bend - __buf;
+ // Similarly to the always_noconv case above.
+ else if (__r == codecvt_base::noconv)
+ {
+ __buf = reinterpret_cast<char*>(__ibuf);
+ __blen = __ilen;
+ }
// Result == error
else
__blen = 0;