Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-05 13:32:40

From: "Beman Dawes" <bdawes_at_[hidden]>
> At 10:02 AM 1/5/2003, Peter Dimov wrote:
> >That's an excellent point, and I'm glad that wide paths aren't
> >out of the question!
> I had a conversation with Bill Plauger, Howard Hinnant, and several other
> library implementors at the last C++ committee meeting, and we agreed on a
> possible approach to the conversion problem. Conversions between wide and
> narrow names has always been the hold up. No one has been willing to step
> forward and say "Of all the possible ways to do the conversion, here is
> libraries should do it."

I did, here:

"That said, let me outline a "reference conversion" on a system where
the native file name is an NTBS, and wchar_t is UCS-x.

* If the wchar_t sequence contains only characters in the [1..255]
range and does not start with 0xEF 0xBB 0xBF, use the corresponding
byte sequence;

* Otherwise, convert the wchar_t sequence to UTF-8 and prepend 0xEF
0xBB 0xBF."

More here:

"The perfect mapping has some pretty obvious properties:

* Equal wchar_t sequences map to equal byte sequences, independent of
OS/runtime/compiler state.

* Different wchar_t sequences map to different byte sequences.

* Identity mapping for file names in a suitably limited character set.

I believe that it is possible to invent a mapping that is very close
to perfect."

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