Re: [PATCHES] Changes in /contrib/fulltextindex - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] Changes in /contrib/fulltextindex
Date
Msg-id 9389.1025530110@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] Changes in /contrib/fulltextindex  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: [PATCHES] Changes in /contrib/fulltextindex
List pgsql-hackers
"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;
}




pgsql-hackers by date:

Previous
From: Manfred Koizar
Date:
Subject: HeapTupleHeader withoud oid
Next
From: Tom Lane
Date:
Subject: Re: DROP COLUMN Proposal