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
completely
> >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
how
> libraries should do it."

I did, here:

http://groups.google.com/groups?selm=7dc3b1ea.0210080714.6bd1e1d5%40posting.
google.com

"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:

http://groups.google.com/groups?selm=7dc3b1ea.0210090707.cf95281%40posting.g
oogle.com

"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 acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk