[Bug libstdc++/14623] UTF-8 encoding, wcout vs. file

peturr02 at ru dot is gcc-bugzilla@gcc.gnu.org
Thu Mar 18 10:03:00 GMT 2004


------- 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



More information about the Gcc-bugs mailing list