(Was: Re: [Boost-users] Filesystem, serialization, character encoding and portable software)
I understand that to get a UTF-8 XML file, I need to use a wide-character stream, but I can't seem to understand how I can compress a serialized UTF-8 xml archive... it seems I can either do:
namespace bio = boost::iostreams;
namespace fs = boost::filesystem;
fs::wofstream ofs(path,ios::binary);
bio::filtering_stream<bio::output,wchar_t> out;
out.push(bio::gzip_compressor()); // PROBLEM: gzip_compressor only accepts char
out.push(ofs);
boost::archive::xml_woarchive oa(out);
--- OR ---
fs::ofstream ofs(path,ios::binary);
bio::filtering_stream<bio::output> out;
out.push(bio::gzip_compressor());
out.push(ofs);
boost::archive::xml_woarchive oa(out); // PROBLEM: only accepts wostream