Re: UTF8 regexp and char classes still does not work
От | Tom Lane |
---|---|
Тема | Re: UTF8 regexp and char classes still does not work |
Дата | |
Msg-id | 29812.1285711252@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | UTF8 regexp and char classes still does not work (Sergey Burladyan <eshkinkot@gmail.com>) |
Ответы |
Re: UTF8 regexp and char classes still does not work
|
Список | pgsql-hackers |
Sergey Burladyan <eshkinkot@gmail.com> writes: > As i can see in Tom's patch 0d323425 only functions like pg_wc_isalpha is changed, but > this pg_wc_isalpha is called from > static struct cvec * > cclass(struct vars * v, /* context */ > const chr *startp, /* where the name starts */ > const chr *endp, /* just past the end of the name */ > int cases) /* case-independent? */ > function, and this function have comment "For the moment, assume that only char codes < 256 can be in these classes" andit call pg_wc_isalpha like this: > for (i = 0; i <= UCHAR_MAX; i++) > { > if (pg_wc_isalpha((chr) i)) > addchr(cv, (chr) i); > } > UCHAR_MAX is 255 Hmm, you're right. I only tested that on Latin1 characters, for which it does work because those have Unicode points below 256. I'm not sure of a reasonable solution for the general case --- we certainly don't want this function iterating up to 2^21 or thereabouts. Your test case seems to be using KOI8 encoding, though, which doesn't have anything to do with UTF8 behavior. regards, tom lane
В списке pgsql-hackers по дате отправления: