Re: regular expressions stranges - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: regular expressions stranges
Date
Msg-id 45B6276F.6050404@sigaev.ru
Whole thread Raw
In response to Re: regular expressions stranges  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: regular expressions stranges
List pgsql-hackers
> The regex code is working with pg_wchar strings, which aren't
> necessarily the same representation that the OS' wide-char functions
> expect.  If we could guarantee compatibility then the above plan
> would make sense ...

it seems to me, that is possible for UTF8 encoding. So isalpha() function may be 
defined as:

static int
pg_wc_isalpha(pg_wchar c)
{    if ( (c >= 0 && c <= UCHAR_MAX) )return isalpha((unsigned char) c)
#ifdef HAVE_WCSTOMBS    else if ( GetDatabaseEncoding() == PG_UTF8 )return iswalpha((wint_t) c)
#endif    return 0;
}



-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From:
Date:
Subject: Re: STOP all user access except for admin for a few minutes?
Next
From: Tom Lane
Date:
Subject: Re: regular expressions stranges