Re: [Boost-bugs] [Boost C++ Libraries] #3088: Support of std::wstring versions of boost::iostreams::basic_file::open()

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3088: Support of std::wstring versions of boost::iostreams::basic_file::open()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-06-09 22:34:52


#3088: Support of std::wstring versions of boost::iostreams::basic_file::open()
-------------------------------+--------------------------------------------
  Reporter: anonymous | Owner: turkanis
      Type: Feature Requests | Status: new
 Milestone: Boost 1.40.0 | Component: iostreams
   Version: Boost 1.39.0 | Severity: Optimization
Resolution: | Keywords:
-------------------------------+--------------------------------------------

Comment(by anonymous):

 Agreed...
 On Windows with msvc 2008, we end up doing something like:


 {{{
 wchar_t wideFile = L"example.txt"; // file we want to open with boost
 std::string fileName;

 // first call gets buffer size
 int bufSize = ::WideCharToMultiByte(CP_ACP, 0, wideFile, -1,
                                     NULL, 0, NULL, NULL);

 fileName.resize (bufSize);

 // second call converts the filename
 int iRet = ::WideCharToMultiByte(CP_ACP, 0, wideFile, -1,
                                  &fileName.at(0), bufSize, NULL, NULL);

 boost::iostreams::file_sink(fileName.c_str(), ...)
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3088#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC