to use boost::filesystem with UTF-8 path?
This piece of code show an example using boost::filesystem and boost::locale to deal with UTF-8 path.
Example
This example explain how to use boost::filesystem in cross-platform manner. This especially handle the Windows UTF-16 case.
#include <iostream>
#include <boost/filesystem.hpp>
#include <boost/locale.hpp>
{
char utf8[] = {0xC5, 0xAA, 0x6E, 0xC4, 0xAD, 0x63, 0xC5, 0x8D, 0x64, 0x65, 0xCC, 0xBD, 0};
std::string utf8xx(utf8);
std::local loc = boost::locale::generator().generate("");
std::locale::global(loc);
boost::filesystem::path::imbue(std::locale());
boost::filesystem::path path("foo");
path /= "bar";
path /= utf8xx;
std::cout << "path:" << path.string() << std::endl;
return 0;
}