diff --git a/src/zipios++/zipoutputstream.cpp b/src/zipios++/zipoutputstream.cpp index d8104395ba..4c40469955 100644 --- a/src/zipios++/zipoutputstream.cpp +++ b/src/zipios++/zipoutputstream.cpp @@ -5,6 +5,9 @@ #include "zipoutputstreambuf.h" #include "zipoutputstream.h" +#if defined(_WIN32) && defined(ZIPIOS_UTF8) +#include +#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 ) ; }