Re: UNICODE and regex character classes

From: David Norris <danorris(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: UNICODE and regex character classes
Date: 2004-08-05 16:49:52
Message-ID: cb16575904080509495dd4b864@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message mike g 2004-08-06 04:40:35 Re: take endless time to MAKE on RH Linux 9
Previous Message Tom Lane 2004-08-05 14:17:05 Re: shared memory after server kill