Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-08-25 05:50:04

> Win32 doesn't support UTF-8 filenames natively. That's why
> boost::filesystem would have to convert t o/from UCS-2 along Win32
> interface boundaries.
> If you're concerned about other platforms, you shouldn't be.
> boost::filesystem currently works only with latin encodings in ascii
> strings so no functionality would be taken away.

Not true: currently the narrow character strings passed to boost.filefsystem
are assumed to be in that platforms native encoding - you can for example
pass native Windows narrow character strings (not just ACSII ones) to the
lib, and actually I don't see why you can't pass UTF-8 on Linux. What you
can't do is use the same encoding on all platforms, because the underlying
platform API's won't understand them.

Heres my (non-portable) test code BTW:

namespace fs = boost::filesystem;

int _tmain(int argc, _TCHAR* argv[])
const char* name = "étrange.txt";
fs::path p(name, fs::native);

fs::ofstream os(p);
os << "Ha! Ha! Ha!";

return 0;


Boost list run by bdawes at, gregod at, cpdaniel at, john at