J
Jonathan Mcdougall
I started using boost's filesystem library a
couple of days ago. In its FAQ, it states
"Wide-character names would provide an illusion of
portability where portability does not in fact
exist. Behavior would be completely different on
operating systems (Windows, for example) that
support wide-character names, than on systems
which don't (POSIX). Providing functionality that
appears to provide portability but in fact
delivers only implementation-defined behavior is
highly undesirable. Programs would not even be
portable between library implementations on the
same operating system, let alone portable to
different operating systems.
The C++ standards committee Library Working Group
discussed this in some detail both on the
committee's library reflector and at the Spring,
2002, meeting, and feels that (1) names based on
types other than char are extremely non-portable,
(2) there are no agreed upon semantics for
conversion between wide-character and
narrow-character names for file systems which do
not support wide-character name, and (3) even the
committee members most interested in
wide-character names are unsure that they are a
good idea in the context of a portable library.
(boost/libs/filesystem/doc/faq.htm)"
This surprised me, since I thought wide characters
were mandatory in production code.
In fact, of all the libraries I am using right
now, very few of them are Unicode compatible.
Therefore, I am stuck with two choices: abandon
Unicode for the profit of plain chars or do time
consuming and not necessarily valid conversions
between wide-character narrow-characters strings.
I have several questions about this.
1. Are C++ wide-character strings used in real
life, in production code?
2. Is it a good idea to let the user choose
between Unicode and ASCII in a library in a
transparent way (such as Microsoft's -A and -W
versions of all functions)?
3. What is the best way to convert wide strings to
and from narrow strings? System-dependent
functions? A simple loop converting char's to
wchar_t's?
4. Will C++0x provide more means for using wide
and narrow strings, such as conversions and
transparency (converting "strings" into L"strings"
automatically, for example, providing standard
macros such as UNICODE)
5. Are wide characters meant to be used with
Unicode or are they provided for an
implemention-defined use?
Thank you,
Jonathan
couple of days ago. In its FAQ, it states
"Wide-character names would provide an illusion of
portability where portability does not in fact
exist. Behavior would be completely different on
operating systems (Windows, for example) that
support wide-character names, than on systems
which don't (POSIX). Providing functionality that
appears to provide portability but in fact
delivers only implementation-defined behavior is
highly undesirable. Programs would not even be
portable between library implementations on the
same operating system, let alone portable to
different operating systems.
The C++ standards committee Library Working Group
discussed this in some detail both on the
committee's library reflector and at the Spring,
2002, meeting, and feels that (1) names based on
types other than char are extremely non-portable,
(2) there are no agreed upon semantics for
conversion between wide-character and
narrow-character names for file systems which do
not support wide-character name, and (3) even the
committee members most interested in
wide-character names are unsure that they are a
good idea in the context of a portable library.
(boost/libs/filesystem/doc/faq.htm)"
This surprised me, since I thought wide characters
were mandatory in production code.
In fact, of all the libraries I am using right
now, very few of them are Unicode compatible.
Therefore, I am stuck with two choices: abandon
Unicode for the profit of plain chars or do time
consuming and not necessarily valid conversions
between wide-character narrow-characters strings.
I have several questions about this.
1. Are C++ wide-character strings used in real
life, in production code?
2. Is it a good idea to let the user choose
between Unicode and ASCII in a library in a
transparent way (such as Microsoft's -A and -W
versions of all functions)?
3. What is the best way to convert wide strings to
and from narrow strings? System-dependent
functions? A simple loop converting char's to
wchar_t's?
4. Will C++0x provide more means for using wide
and narrow strings, such as conversions and
transparency (converting "strings" into L"strings"
automatically, for example, providing standard
macros such as UNICODE)
5. Are wide characters meant to be used with
Unicode or are they provided for an
implemention-defined use?
Thank you,
Jonathan