Boost logo

Boost :

Subject: Re: [boost] [filesystem] Version 3 request for comments
From: Beman Dawes (bdawes_at_[hidden])
Date: 2009-02-06 20:36:02

On Fri, Feb 6, 2009 at 1:22 PM, Ulrich Eckhardt <doomster_at_[hidden]> wrote:
> On Sunday 01 February 2009 18:53:11 Beman Dawes wrote:
>> A prototype implementation of version 3 of Boost.Filesystem is available
>> for comment.
> I have one specific question which I wonder how your proposal handles it:
> Imagine a system where strings for filesystems are by default encoded in a
> certain encoding like e.g. Latin-1. Now, I mount a CD that is encoded in
> UTF-8. The system itself neither enforces Latin-1 nor does it in any way
> validate the mounted filesystem, so I might have a path that contains parts
> in Latin-1 and parts in UTF-8.

Yes, and I think that is possible whether you are using
Boost.Filesystem or native API calls.

> How does your proposed filesystem library handle such a beast?

You could decompose the path, setting the appropriate locale/codecvt
facet at each step of the way. That assumes you know how each element
of the path is encoded.

Alternately, you could decompose the path into elements of
path::string_type, and then convert the elements that need it to
whatever other encoding you wish.

So Boost.Filesystem helps with some of the details, but it is still
really up to you to know what encodings are involved.

Did that answer your question?


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