
Robert Ramey wrote:
Jonathan Turkanis wrote:
Robert Ramey wrote:
Note the the serialization library contains code for doing exactly this.
Note that the implementation above is not dependent on codecvt nor on streams. It just converts wstring to string and back again.
The code_converter component I mentioned doesn't use streams either. But it can be used to adapt streams -- to turn a narrow character stream into a wide character stream or vice versa. We've already discussed the tradeoffs between using iterators or objects with a socket-like interface to perform filtering: http://lists.boost.org/MailArchives/boost/msg70761.php It is crucial to support codecvts, since this is how the C++ standard libraries encapsulates code conversion. If you don't allow for a user-supplied codecvt, you can't reuse the large number that have already been written, such as the dozens that come with the Dinkumware CoreX library.
Robert Ramey
Jonathan