>>>>> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes:

Georg> Am Donnerstag, 26. Oktober 2006 18:05 schrieb Jean-Marc
Georg> Lasgouttes:
>> Can't we just change the encoding of the output stream on the fly
>> (with a method, not only in the constructor)?

Georg> That was my first idea, but it turned out to be rather
Georg> difficult. Here is how I came to the current solution:

Georg> codecvt facets are only used by file streams 

Is that a limitation of the gcc implmentation, or is it the standard
that specified such a stupid thing?

Georg> Next try: Maybe we could do something else than codecvt in our
Georg> streams, and add a setEncoding() method? That does not work
Georg> unless we rebuild the functionality of file and string streams,
Georg> since both odocfstream and odocstringstream inherit from
Georg> std::basic_ostream<docstring> and we can neither add a method
Georg> to that class nor change the inheritance of the file and string
Georg> streams.

Why not implement a  modifier like
  os << setencoding("iso-8859-1")
?

Georg> What might be possible is to encapsulate the real file and
Georg> string streams in our own version, and use a homemade streambuf
Georg> that would do the encoding conversion and then forward to the
Georg> real stream. That would probably work, but would require far
Georg> more code and a good understanding of stream buffers to get it
Georg> right. 

I understand. I see that boost has some intriguing stream stuff. Can
this be used?
http://www.boost.org/libs/iostreams/doc/

JMarc

Reply via email to