This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/14623] UTF-8 encoding, wcout vs. file
- From: "peturr02 at ru dot is" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Mar 2004 10:03:39 -0000
- Subject: [Bug libstdc++/14623] UTF-8 encoding, wcout vs. file
- References: <20040317231656.14623.bkoz@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From peturr02 at ru dot is 2004-03-18 10:03 -------
The testcase has a bug:
cout << locale().name() << endl;
Since this is the first I/O operation on stdout, it causes stdout to become
a byte-oriented stream (fwide(stdout, 0) < 0). Doing wide I/O on a narrow
stream is not a good idea. See what happens if cout is replaced (everywhere)
with cerr and "printf(" with "fprintf(stderr, ".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14623