zipios: unicode handling in ZipOutputStream
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
|
||||
#include "zipoutputstreambuf.h"
|
||||
#include "zipoutputstream.h"
|
||||
#if defined(_WIN32) && defined(ZIPIOS_UTF8)
|
||||
#include <Base/FileInfo.h>
|
||||
#endif
|
||||
|
||||
using std::ostream;
|
||||
|
||||
@@ -25,7 +28,12 @@ ZipOutputStream::ZipOutputStream( const std::string &filename )
|
||||
: std::ostream( nullptr ),
|
||||
ofs( nullptr )
|
||||
{
|
||||
#if defined(_WIN32) && defined(ZIPIOS_UTF8)
|
||||
std::wstring wsfilename = Base::FileInfo(filename).toStdWString();
|
||||
ofs = new std::ofstream( wsfilename.c_str(), std::ios::out | std::ios::binary ) ;
|
||||
#else
|
||||
ofs = new std::ofstream( filename.c_str(), std::ios::out | std::ios::binary ) ;
|
||||
#endif
|
||||
ozf = new ZipOutputStreambuf( ofs->rdbuf() ) ;
|
||||
this->init( ozf ) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user