"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Good idea. Is there a locale-aware version of isalpha anywhere?
>>
>> If there is - I couldn't find it. I did find a lot of frustated
>> posts about isalpha and locale-awareness although.
> Yeah, I can't find anything in the man pages either. Maybe we can ask the
> list. People?
Huh? isalpha() *is* locale-aware according to the ANSI C spec.
For instance, the attached test program finds 52 alpha characters
in C locale and 114 in fr_FR locale under HPUX.
I am not at all sure that this aspect of Florian's change is a good
idea, as it appears to eliminate locale-awareness in favor of a hard
coded delimiter list.
regards, tom lane
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <locale.h>
int main(int argc, char **argv)
{ int i;
setlocale(LC_ALL, "");
for (i = 0; i < 256; i++) if (isalpha(i)) printf("%d %c\n", i, i);
return 0;
}