Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] [GENERAL] plperl and regexps with accented characters - incompatible?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: hubert depesz lubaczewski <depesz(at)depesz(dot)com>, pgsql-hackers(at)postgresql(dot)org, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] [GENERAL] plperl and regexps with accented characters - incompatible?
Date: 2007-11-29 05:39:30
Message-ID: 474E5092.40906@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-patches

Andrew Dunstan wrote:
>
>
> Andrew Dunstan wrote:
>>
>>
>> Greg Sabino Mullane wrote:
>>> Just as a followup, I reported this as a bug and it is being looked 
>>> at and discussed:
>>>
>>> http://rt.perl.org/rt3//Public/Bug/Display.html?id=47576
>>>
>>> Appears there is no easy resolution yet.
>>>
>>>
>>>   
>>
>> We might be able to do something with the suggested workaround. I 
>> will see what I can do, unless you have already tried.
>>
>>
>
> OK, I have a fairly ugly manual workaround, that I don't yet 
> understand, but seems to work for me.
>
> In your session, run the following code before you do anything else:
>
> CREATE OR REPLACE FUNCTION test(text) RETURNS bool LANGUAGE plperl as $$
> return shift =~ /\xa9/i ? 'true' : 'false';
> $$;
> SELECT test('a');
> DROP FUNCTION test(text);
>
> After that we seem to be good to go with any old UTF8 chars.
>
> I'm looking at automating this so the workaround can be hidden, but 
> I'd rather understand it first.
>
> (Core guys: If we can hold RC1 for a bit while I get this fixed that 
> would be good.)
>
>

The attached patch works for me to eliminate the errors. Please test ASAP.

cheers

andrew

Attachment: plperl-utf8fix.patch
Description: text/x-patch (2.2 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-11-29 05:40:57
Subject: Re: jaguar is up
Previous:From: Tom LaneDate: 2007-11-29 05:32:18
Subject: Re: unclear enum error messages

pgsql-patches by date

Next:From: Tom LaneDate: 2007-11-29 05:55:53
Subject: Re: [PATCHES] Partition: use triggers instead of rules
Previous:From: David FetterDate: 2007-11-29 03:17:02
Subject: Re: [PATCHES] Partition: use triggers instead of rules

pgsql-general by date

Next:From: Tom LaneDate: 2007-11-29 05:57:06
Subject: Re: Create index syntax error
Previous:From: ChrisDate: 2007-11-29 05:29:08
Subject: Re: Create index syntax error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group