Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-07-01 07:34:42


Peter Dimov wrote:

> Vladimir Prus wrote:
>>
>> For example, you surely want to create boost::path from Unicode
>> string. Do you want to create them from ascii string?
>
> Yes.

Ok.

>> What encoding that ascii string should be in?
>
> Implementation (OS) defined (by 'ASCII string' you mean narrow string, I
> presume, since ASCII _is_ an encoding).

(Yes, I meant narrow string).
That's a kind of answer I hoped for. This means that just
basic_path<wchar_t> is not so good, since it won't have conversion from
char*.

>> Would you want to convert unicode path back to ascii?
>
> There is no such thing as an "Unicode path". A path is a path.

Unless there are two classes, basic_path<char> and basic_path<wchar_t>, of
course, in which case they are 8-bit path and unicode path.

> A path
> constructed from a wide string should be able to give you a narrow string,
> but whether this narrow string will construct the same path is
> implementation defined.

Do you think it should be able to *always* give you a narrow string? Even if
OS-defined 8-bit encoding cannot represent some of the characters in the
original wide string. Won't throwing be more appropriate?

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net