Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Kaz Kylheku <kaz@kylheku.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: wchar_t is useless |
| Date | 2011-11-21 21:02 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <20111121125000.483@kylheku.com> (permalink) |
| References | <jadmcb$b90$1@oravannahka.helsinki.fi> <87ipmdxqpw.fsf@blp.benpfaff.org> |
On 2011-11-21, Ben Pfaff <blp@cs.stanford.edu> wrote:
> Lauri Alanko <la@iki.fi> 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.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
wchar_t is useless Lauri Alanko <la@iki.fi> - 2011-11-21 14:14 +0000
Re: wchar_t is useless Kaz Kylheku <kaz@kylheku.com> - 2011-11-21 16:17 +0000
Re: wchar_t is useless James Kuyper <jameskuyper@verizon.net> - 2011-11-21 12:27 -0500
Re: wchar_t is useless jgk@panix.com (Joe keane) - 2011-11-24 20:07 +0000
Re: wchar_t is useless Kaz Kylheku <kaz@kylheku.com> - 2011-11-24 21:16 +0000
Re: wchar_t is useless James Kuyper <jameskuyper@verizon.net> - 2011-11-24 17:15 -0500
Re: wchar_t is useless Keith Thompson <kst-u@mib.org> - 2011-11-24 13:49 -0800
Re: wchar_t is useless Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-27 10:33 +0000
Re: wchar_t is useless Rui Maciel <rui.maciel@gmail.com> - 2011-11-25 14:17 +0000
Re: wchar_t is useless Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-25 15:27 +0100
Re: wchar_t is useless Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-25 15:29 +0100
Re: wchar_t is useless Dann Corbit <dcorbit@connx.com> - 2011-11-22 09:50 -0800
Re: wchar_t is useless blp@cs.stanford.edu (Ben Pfaff) - 2011-11-21 10:42 -0800
Re: wchar_t is useless jmclnx@SPAMisBADgmail.com (Jack McCue) - 2011-11-21 19:18 +0000
Re: wchar_t is useless Kaz Kylheku <kaz@kylheku.com> - 2011-11-21 21:02 +0000
Re: wchar_t is useless Lauri Alanko <la@iki.fi> - 2011-11-21 22:07 +0000
Re: wchar_t is useless Kaz Kylheku <kaz@kylheku.com> - 2011-11-21 23:54 +0000
Re: wchar_t is useless Lauri Alanko <la@iki.fi> - 2011-11-22 01:15 +0000
Re: wchar_t is useless Kaz Kylheku <kaz@kylheku.com> - 2011-11-22 01:57 +0000
Re: wchar_t is useless Lauri Alanko <la@iki.fi> - 2011-11-22 09:28 +0000
Re: wchar_t is useless Acid Washed China Blue Jeans <chine.bleu@yahoo.com> - 2011-11-21 11:11 -0800
Re: wchar_t is useless "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2011-11-24 08:43 -0800
Re: wchar_t is useless 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-24 16:42 -0800
csiph-web