This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: std::codecvt::out() returns a no-op in marginal situations
----- Original Message -----
From: "Paolo Carlini" <pcarlini@suse.de>
To: "Sam Varshavchik" <mrsam@courier-mta.com>
Cc: <libstdc++@gcc.gnu.org>; <bop@gmb.dk>
Sent: Monday, January 21, 2008 12:30 PM
Subject: Re: std::codecvt::out() returns a no-op in marginal
situations
Sam Varshavchik wrote:
So, if out() returns with:
1) from_next < from_end, and
2) to_next < to_end
then can I assume that out() wants a larger output buffer?
In short, I think so. I cannot imagine how things could be
different:
one internal element is enough for a meaningful conversion, and you
know
you have got it. And you have a partial return value. The only
possible
explanation is that the output buffer is too small.
Yes, I have to agree on this.
Sam's idea that do_out should output half a character and save the
rest for unshift, is not allowed by the standard. The Effects clause
for do_unshift specifically says that codecvt for char/char and
wchar_t/char "store no characters".
Bo Persson