Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-11-16 11:16:20


> Does this suppose that all OS paths can be represented as a string of
> wchar's? Does it suppose that the whole range that wchar_t can cover
> is usable in file names? Would that have to be added to the wchar_t
> definition?
> What if I want to use a 32-bit Unicode codepoint for a filename on
> Windows?

wchar_t is supposed to be able to hold all the characters that are supported
by the operating system, so any narrow character multi-byte sequence should
be representable as a wide character one, but...

Not all wide character sequences can be represented as a narrow character
one (depending upon the encoding used), and if the underlying OS uses narrow
character strings as path names (unix), and the wide character sequence can
not be converted, then the file can not exist, so we get an error either
which way.

As for using UTF-32 strings on Windows, are surrogates allowed as path name
characters? If "yes" then I guess it's supported (but you may have to do
the UTF-32 to UTF-16 conversion yourself), this is an area that needs more
thought.

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk