utf8 encoding problem with plperlu

Поиск
Список
Период
Сортировка
От Ronald Peterson
Тема utf8 encoding problem with plperlu
Дата
Msg-id CAJPRK8b5==HNrsrRy9C-uE394Uje+e4EyUtjF_TuRoB6mX9Tqg@mail.gmail.com
обсуждение исходный текст
Ответы Re: utf8 encoding problem with plperlu  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: utf8 encoding problem with plperlu  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-general
The following short function illustrates a problem I'm having with the plperlu module.

CREATE OR REPLACE FUNCTION
doublezero ()
RETURNS VOID
AS $$
use Encode qw/encode decode/;
$pass = "double00";
elog( INFO, "$pass" );
$mspass = encode( 'UTF-16LE', qq("$pass") );
elog( INFO, "$mspass" );
$$ LANGUAGE plperlu
STRICT;

# select * from doublezero();
INFO:  double00
CONTEXT:  PL/Perl function "doublezero"
ERROR:  invalid byte sequence for encoding "UTF8": 0x00 at line 8, <DATA> line 558.
CONTEXT:  PL/Perl function "doublezero"

I don't understand this.  I need to pass $mspass to Active Directory, and it the encoding is exactly as it should be, which is to say, it works for strings that don't include two consecutive zeros.  Is this a bug?

-R-




В списке pgsql-general по дате отправления:

Предыдущее
От: Ryan King - NOAA Affiliate
Дата:
Сообщение: Re: could not create shared memory segment: Invalid argument
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: utf8 encoding problem with plperlu