Re: wchar_t is useless



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
strings.

I agree with you.

The libunistring manual has a section that says pretty much what
you did in your message, by the way:
http://www.gnu.org/software/libunistring/manual/libunistring.html#The-wchar_005ft-mess

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.''

Eerie similarity!

I don't agree with this libunistring manual. The wchar_t type is useful and
just fine.

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:

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
character constant.

I very much doubt that FreeBSD and Solaris go against the grain on this one
in any way.
.



Relevant Pages

  • Re: choice question - newbie
    ... If every other machine at your location is using Solaris, ... If you need a decent desktop, use Windows or Mac OS X. ... have gradually started using FreeBSD as my main desktop OS. ... one here can tell whether Linux or Solaris would be better for you. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: Raw Convertors
    ... First there is too little choice (or enough choice on Windows), ... One wonders how PHP does Solaris, HP-UX, OpenBSD, NetBSD, FreeBSD, ... One wonders how GCC can support all that and many others --- ...
    (rec.photo.digital)
  • Re: Raw Convertors
    ... First there is too little choice (or enough choice on Windows), ... One wonders how PHP does Solaris, HP-UX, OpenBSD, NetBSD, FreeBSD, ... One wonders how GCC can support all that and many others --- ...
    (rec.photo.digital)
  • Re: What do you dislike about OSX?
    ... is is when you claim that OS X is derivative of FreeBSD. ... about *other people* not needing to have all windows visible at all times. ... Most end users don't even know the bug exists. ... offer reasons for me to change my mind. ...
    (comp.sys.mac.advocacy)
  • Re: Convince me, please!
    ... familiar to the Unix OSes that are around. ... PS Try some googling or the freebsd official site for more resources. ... desktop users who have previously known only Windows. ... applications, including its most commonly used browser, office ...
    (freebsd-questions)