Boost logo

Boost :

Subject: Re: [boost] [filesystem]Extracting path as string from wpath
From: Beman Dawes (bdawes_at_[hidden])
Date: 2008-10-17 10:10:01

On Fri, Oct 17, 2008 at 7:17 AM, Johan Torp <johan.torp_at_[hidden]> wrote:

> How do convert a boost::filesystem::wpath to a known encoding in the native
> filesystem's path representation?
> Specifically I want to convert a boost::filesystem::wpath to a third party
> string (CFString from Carbon). In order to do that I must know the encoding
> of wpath.string() or wpath.external_file_string() on Mac, which is
> "implementation defined".

wpath.external_file_string() returns the type and encoding required by the
platform. For Mac OS X, the type is std::string, and the Apple web site says
the encoding is Unicode. I assume that means UTF-8, although I couldn't find
that stated explicitly.

> Interfacing boost::filesystem::wpath with 3rd party APIs seems like common
> problem.

Sure. That's why external_file_string is exposed.

Internationalization should be a bit easier with Boost.Filesystem Version 3
that I'm working on, because there is a single path type.


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