Re: wchar.h, wctype.h question

From: G. Adam Stanislav (
Date: Wed May 05 1999 - 22:00:37 EDT

On Wed, May 05, 1999 at 04:53:23PM -0500, John Fieber wrote:
> Devil's advocate here...the standard ctype API includes a
> mechanism for extensions. I'm not saying that it is good and/or
> convenient, but in the interest of completeness it might be wise
> to provide extensions using that mechanism either on top,
> underneath or beside a nicer API. (FreeBSD already implements
> the posix stuff on top of the "rune" API which the authors claim
> is more elegant.)

Oh, hi, John,

Having had a couple hours to think about it, it now seems to me the best thing
to do is to place both libraries into the FreeBSD ports collection, and to
continue working on independent code for the C library.

That will have several advantages over choosing one of the two libraries and
writing a front end for it: The C library will be smaller, while every
programmer will be able to choose which of the two libraries he wants to use
if he needs their extra power.

Yes, the standard ctype API does provide room for extension. At the same time,
the spec says any undefined wctype name (such as iswkanji) is reserved.

The rune API is nice but different from the standard C API in that the rune
API is locale dependent, while the C one is not (if I am reading the specs
right). So, including the code for the Chinese symbol for digit '1' in a call
to iswdigit should return true regardless of whether it is part of the system
locale. Its Unicode code is one for a digit completely independent of whether
my particular computer can actually display it on my screen or read it from
my keyboard. (Substitute anyone's you want for "my" here.) Unicode is Unicode
no matter what.



P.S. I should probably subscribe to the Unicode list. How do I do that?

This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:20:45 EDT