Boost logo

Boost :

From: Ulrich Eckhardt (uli_at_[hidden])
Date: 2004-08-08 18:46:52


On Monday 02 August 2004 16:33, Tilman Kuepper wrote:
> inline void Write()
> {
> locale loc;
> locale utf8loc(loc, new utf8_codecvt_facet<wchar_t, char>());
> wofstream f;
> f.imbue(utf8loc);
> f.open("test.utf8", ios::binary);
> f << wstr;
> assert(f);
> }

Without looking at the real case, the last assert is possibly useless: if
there is still data in some internal buffer, only the stream going out of
scope will flush that (and perhaps fail to do so). BTDT. Just add an
'f.flush()'.

Uli


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk