Re: wchar_t is useless
- From: Kaz Kylheku <kaz@xxxxxxxxxxx>
- Date: Mon, 21 Nov 2011 21:02:50 +0000 (UTC)
On 2011-11-21, Ben Pfaff <blp@xxxxxxxxxxxxxxx> wrote:
Lauri Alanko <la@xxxxxx> writes:
To recap: C's multibyte strings are in a locale-dependent, possibly
variable-width encoding. On Windows, the wchar_t string encoding is
variable-width, on FreeBSD and Solaris it is locale-dependent. So for
portable C code, wchar_t doesn't provide any advantages over multibyte
I agree with you.
The libunistring manual has a section that says pretty much what
you did in your message, by the way:
It probably pretty much says the same thing, because quite likely that text is
the source for Lauri's opinion, or both have some other common source. For
instance, look at this:
``On Solaris and FreeBSD, the wchar_t encoding is locale dependent and undocumented.''
I don't agree with this libunistring manual. The wchar_t type is useful and
The are right about the limitation of Windows, but nobody ever went wrong in
accepting the limitations of Microsoft Windows in order to write software for
users of Windows who have also accepted those limitations.
If you want to do processing with rare languages on Windows, install a virtual
machine running GNU/Linux and you have 32 bit wchar_t. GNU/Linux is more
likely than Redmond to have fonts to display your rare languages, too.
Cleraly the libunistring authors they don't understand what Solaris and FreeBSD
means by "encoding" (and they do not care whether they are right or wrong because,
after all, they have a library which will fix the FreeBSD or Solaris problem,
regardless of whether it is real or imagined.) Hey, a user who needlessly uses your
library is still a user!
And undocumented, by the way? Uh, use the source, Luke?
Oh, and The Single Unix Specification, Issue 6, says this about wchar_t:
Integer type whose range of values can represent distinct wide-character
codes for all members of the largest character set specified among the
locales supported by the compilation environment: the null character has
the code value 0 and each member of the portable character set has a code
value equal to its value when used as the lone character in an integer
I very much doubt that FreeBSD and Solaris go against the grain on this one
in any way.
- Re: wchar_t is useless
- From: Lauri Alanko
- Re: wchar_t is useless
- Prev by Date: Re: Changing type at runtime for image acquisition
- Next by Date: Re: Changing type at runtime for image acquisition
- Previous by thread: Re: wchar_t is useless
- Next by thread: Re: wchar_t is useless