[RFA] Update iswalpha, iswprint, iswpunct (was Re: Update wctype functions to Unicode 5.2?)

Corinna Vinschen vinschen@redhat.com
Wed Feb 17 09:25:00 GMT 2010

On Feb 16 19:03, Corinna Vinschen wrote:
> Below is the patch which revamps iswalpha, iswprint and iswpunct for
> Unicode 5.2.
> What I did was mostly manual work, but I made sure to test it as well as
> to document how to retrieve the data for the tables and the big switch
> statements in comments in the code.
> The easiest part of the patch is in iswpunct.c.  Instead of maintaining
> the big table in utf8punct.h, the entire code is now reduced to
>   return (!iswalnum (c) && iswgraph (c));
> This is the definition of the iswpunct character class.  As long as the
> iswprint and iswalpha character tables are correct, the iswpunct
> function is by definition also correct.  So, no need to keep the tables
> around.

Btw., if you have mixed feelings about this change to iswpunct, I can
also provide a patch which implements it in the old terms of a the
big switch and the tables in utf8punct.h.  It just takes another day.
However, I think it is more elegant to define it as above, because it's
one less point of failure and it saves space.


Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

More information about the Newlib mailing list