|
Boost : |
Subject: Re: [boost] [filesystem]Extracting path as string from wpath
From: Beman Dawes (bdawes_at_[hidden])
Date: 2008-10-20 08:50:00
On Sat, Oct 18, 2008 at 6:51 AM, Johan Torp <johan.torp_at_[hidden]> wrote:
>
>
> Beman Dawes 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.
> >
>
> Sounds interesting, looking forward to it! For V3, I would appreciate
> comprehensive documentation on the format of external_file_string() for
> each
> supported platform.
The problem is that the exact format is determined not by the filesystem
library, but by a conversion function provided by the operating system.
These conversion functions (or the underlying locale facet) do not always
provide detailed documentation.
>
>
> Thanks for an excellent library.
Thanks for the feedback!
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk