Boost logo

Boost Users :

Subject: [Boost-users] [Filesystem] [Locale] Unicode filenames doc example error
From: Egor Tensin (egor.tensin_at_[hidden])
Date: 2013-12-04 12:42:00

Why doesn't this simple code from the Boost.Locale docs work?

#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/locale.hpp>

#include <exception>
#include <iostream>

int main()
    boost::filesystem::ofstream hello("привет.txt");
  catch (const std::exception& e)
    std::cerr << e.what() << std::endl;

  return 0;

Compiled with

>cl /EHsc /D _UNICODE /D UNICODE b.cpp /I%BOOST_ROOT% /MD /link /LIBPATH:%BOOST_ROOT%\stage\lib

it gives me

boost::filesystem::path codecvt to wstring: error

Could someone please explain what's the problem there and how do I
handle Unicode file names on Windows using Boost.Filesystem &

I'm using Boost 1.55.0 & compiling with MS Visual C++ 2010 compiler

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at