dbTalk Databases Forums  

[BUGS] utf-8 flag always off in plperl function arguments

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] utf-8 flag always off in plperl function arguments in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David Kamholz
 
Posts: n/a

Default [BUGS] utf-8 flag always off in plperl function arguments - 12-03-2004 , 02:35 PM






Hello:

Since 5.6 or so, perl has stored an internal flag on every string to
mark whether it's UTF-8 or not. For data of unknown encoding, such as
data read from files, the default is latin1, but it can be changed with
use encoding 'utf8'. Now, I have a postgresql database in charset
UNICODE. So, postgres knows the data is UTF-8. However, when passing
arguments to plperl functions, no matter what the charset, postgres
ALWAYS sets the UTF-8 flag to off. This means that the only way to
handle the string properly in perl, when it matters that perl knows
it's UTF-8, is to use utf8::upgrade -- on every argument, in every
function, every time. This is rather kludgy, considering there already
exists a way to fix it by calling the libperl API properly. It would be
nice if it could be fixed in 8 final (it's exactly the same in 8 beta
and 7.4.6).

Regards,
Dave


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] utf-8 flag always off in plperl function arguments - 12-03-2004 , 02:41 PM






David Kamholz <davekam (AT) pobox (DOT) com> writes:
Quote:
This is rather kludgy, considering there already
exists a way to fix it by calling the libperl API properly.
If you know how to do it, how about offering a patch?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.