Re: UNICODE and regex character classes - Mailing list pgsql-novice

From David Norris
Subject Re: UNICODE and regex character classes
Date
Msg-id cb16575904080509495dd4b864@mail.gmail.com
Whole thread Raw
In response to Re: UNICODE and regex character classes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
> The regex character classes really ought to be encoding- and
> locale-aware.  Right now they are not, but possibly something
> similar to what I recently did to the upper/lower/initcap functions
> would work --- that is, rely on the <wctype.h> C library instead of
> <ctype.h>.  If you feel like working on this, the regex stubs are
> in src/backend/regex/regc_locale.c, and the upper/lower change
> is in src/backend/utils/adt/oracle_compat.c:

I'd love to contribute if I can. But I'm afraid I'm no i18n (or pg
codebase) expert and would need some guidance. If you can answer a
couple questions to get me started I'll gladly see if I can get some
working code.

How does pg_wchar (= unsigned int) work... is it always going to be a
straight Unicode character? Can I safely cast it to a wchar_t, is
there a suitable conversion function in wchar.h, or will I need to
write one that looks at some encoding variables?

Suppose I successfully update the regex char classification functions.
How could I set up an encoding/locale so that the character classes in
regular expressions would be locale-neutral? Remember my end goal is
to have some character class that matches *any* character which
Unicode calls a Letter. I don't want locale-awareness so much as I
want locale-neutrality.

Thanks,
--
David Norris
danorris@gmail.com

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: shared memory after server kill
Next
From: Kenneth Marshall
Date:
Subject: Re: Performance Bottleneck