This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: locale::global and wcout
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Kristian Spangsege <kristian dot spangsege at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Tue, 03 Jul 2007 01:50:24 +0200
- Subject: Re: locale::global and wcout
- References: <19c077830707021636h40b06c1bhbce72df1f343f255@mail.gmail.com>
Hi,
first, a slightly pedantic but important observation: there is only
*one* standard in force, the ISO / IEC Standard 14882: 2003, available
in pdf from ISO or in printed form from Wiley: anything else, in
particular online documents or manuals / books are certainly useful
while learning and studying the C++ language but do not represent by
themselves a standard in any sense.
That said, in the area of locale vs streams, a lot is implementation
defined: our implementation, by defaults has the predefined streams
(cin, cout, wcin, wcout...) synced with stdio. That means that certainly
the wchar_t versions are sensible to the global locale, because they use
directly the underlying wchar_t C library functions to achieve that
sync. You can change that behavior (thus loosing the sync) by calling
sync_with_stdio(false) before any I / O.
Paolo.