This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/12868] New: basic_filebuf::imbue fails too easily
- From: "peturr02 at ru dot is" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Nov 2003 08:14:51 -0000
- Subject: [Bug libstdc++/12868] New: basic_filebuf::imbue fails too easily
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12868
Summary: basic_filebuf::imbue fails too easily
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: peturr02 at ru dot is
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
If basic_filebuf::imbue() is called after a file has been opened, it only
changes the locale if seekoff(0, cur) returns 0. There are two problems with
this:
1) For regular files, the locale can only be changed at the beginning of the
file. This can be a problem for files such as XML files, in which the
encoding is stored in the file itself.
2) For pipes, ttys etc. there is no way to change locale. This is especially
a problem for wcin, wcout, wcerr and wclog, where the only way to set the
locale is to set the global locale before calling sync_with_stdio(false).