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

plperl: enable UTF-8 support

From: David Kamholz <davekam(at)pobox(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: plperl: enable UTF-8 support
Date: 2004-12-05 18:49:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches

Here's a patch I added against plperl, originally against beta5, now 
against rc1. It simply checks with GetDatabaseEncoding() if the current 
database is in UTF-8, and if so, sets the UTF-8 flag on the arguments 
that are passed to perl. This means that it isn't necessary to 
utf8::upgrade() every string, as perl has no way of knowing offhand 
that a string is UTF-8 -- but postgres does, because the database 
encoding is specified, so it makes sense to turn the flag on. You 
should also be able to properly manipulate UTF-8 strings now from 
plperl as opposed to plperlu, because otherwise you'd have to use 
encoding 'utf8' which was not allowed. It could also eliminate some 
unexpected bugs if you assume that perl knows the string is unicode. It 
is enabled only for perl 5.6 and higher, so earlier versions will not 
be affected.

I have been assured by crab that the patch is quite harmless and will 
not break anything. It would be great to see it in 8 final! :-)


Attachment: plperl.c.diff
Description: application/text (2.0 KB)


pgsql-patches by date

Next:From: Andrew DunstanDate: 2004-12-05 19:06:05
Subject: Re: patch contrib/pgcrypto for win32 (2)
Previous:From: Korea PostgreSQL Users' GroupDate: 2004-12-05 15:51:28
Subject: patch contrib/pgcrypto for win32 (2)

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