This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/12868] basic_filebuf::imbue fails too easily


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



------- Additional Comments From peturr02 at ru dot is  2003-11-04 08:57 -------
> The strict conditions on filebuf::imbue are a result of not being able to
> deal with possible re-conversion at the time filebuf::imbue is called.
> (See the Yikes comment in the code.)

There is no problem for output; just call overflow() to flush the buffer
with the old locale, then switch to the new locale. For input, I think
_M_ext_buf is the key. There is no need to "reconstruct the original
contents of the file", because the original contents are stored in
_M_ext_buf. The current position can be found with codecvt::length(), as
in seekoff().


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]