Re: plperlu problem with utf8 - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: plperlu problem with utf8
Date
Msg-id 4CFFAD54.1010002@dunslane.net
Whole thread Raw
In response to plperlu problem with utf8  (Oleg Bartunov <oleg@sai.msu.su>)
Responses Re: plperlu problem with utf8  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-hackers

On 12/08/2010 10:13 AM, Oleg Bartunov wrote:
> Hi there,
>
> below is the problem, which I don't have when running in shell. The 
> database is in UTF-8 encoding.
>
> CREATE OR REPLACE FUNCTION url_decode(Vkw varchar) RETURNS varchar  AS $$
>     use strict;
>     use URI::Escape;
>     return uri_unescape($_[0]); $$ LANGUAGE plperlu;
> CREATE FUNCTION
> Time: 1.416 ms
> select url_decode('comment%20passer%20le%20r%C3%A9veillon');
>           url_decode ------------------------------
>  comment passer le rveillon
>                   ^
>                  non-printed


I get: (platform is Fedora 13, git tip, perl 5.10.1):
   andrew=# CREATE OR REPLACE FUNCTION url_decode(Vkw varchar) RETURNS   varchar  AS $$   andrew$#     use strict;
andrew$#    use URI::Escape;   andrew$#     return uri_unescape($_[0]); $$ LANGUAGE plperlu;   CREATE FUNCTION
andrew=#select url_decode('comment%20passer%20le%20r%C3%A9veillon');              url_decode
------------------------------    comment passer le réveillon   (1 row)
 
   andrew=#

which makes it look like we might have some double escaping going on 
here, but at least I don't get nothing :-)

Further experimentation shows even more weirdness. There's definitely 
something odd about the utf8 handling. Will dig further.

cheers

andrew





pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Spread checkpoint sync
Next
From: Tom Lane
Date:
Subject: Re: pg_type.typname of array types.