Re: GRegex



On Tue, 2006-10-24 at 16:48 -0400, Dominic Lachowicz wrote:
> On 10/24/06, Behdad Esfahbod <behdad behdad org> wrote:
> > On Tue, 2006-10-24 at 16:05 -0400, Marco Barisione wrote:
> > >
> > > If you prefer you can pass --enable-system-pcre to use the
> > > system-supplied library but, if it's compiled without utf-8 support,
> > > g_regex_new fails.
> >
> > This is broken.  It should err at configure time, not run time.  The
> > user shouldn't need to check the output of g_regex_new for failures,
> > just like any other thing we do with glib.
> 
> It should be possible to write an auto* check that basically checks
> whether something like:
> 
> #include <pcre.h>
> int main(int argc, char ** argv) {
> int has_utf8_support;
>  if(pcre_config(PCRE_CONFIG_UTF8,  &has_utf8_support))
>    return has_utf8_support;
>  return 0;
> }
> 
> returns '1' or '0'. If so, we should probably favor the system
> installation of PCRE over the glib-supplied one.

At the expense of relying whatever older version of the Unicode
Character Database that is using, and of course loading two sets of
Unicode data tables into memory.  PCRE itself is rather small compared
to the data tables, so last time the conclusion was that using glib's
probably makes more sense as they are already in memory anyway.

> Best,
> Dom
-- 
behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]