Re: BUG #6344: Trouble with plperl - Mailing list pgsql-bugs

From Alex Hunsaker
Subject Re: BUG #6344: Trouble with plperl
Date
Msg-id CAFaPBrT=+ENFrJWNg7Z80XxsV3RvOTpExYm5BhAC+k6PTQ0=0g@mail.gmail.com
Whole thread Raw
In response to BUG #6344: Trouble with plperl  (k_denisov@inbox.ru)
List pgsql-bugs
On Sun, Dec 18, 2011 at 01:25,  <k_denisov@inbox.ru> wrote:
> The following bug has been logged on the website:
>
> Bug reference: =C2=A0 =C2=A0 =C2=A06344
> Logged by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Kirill
> Email address: =C2=A0 =C2=A0 =C2=A0k_denisov@inbox.ru
> PostgreSQL version: 9.1.2
> Operating system: =C2=A0 Linux Debian
> Description:
>
> plperl function:
> open(FILE,">>/test/test.txt");
> print FILE "=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0(Cyrillic tex=
t)";
> close FILE;
> Base codepage and client codepage cp1251.
> Record in file broken codepage.

Im not exactly sure what you are saying, but my hunch is you need to
use Encode or give the file handle an encoding:
binmode(FILE, ':encoding(cp1251)'); (or via open)

or

use Encode qw(encode);
my $str =3Ddecode("cp1251", "=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=
=B0(Cyrillic text));
print FILE $str;

pgsql-bugs by date:

Previous
From: Martin Pitt
Date:
Subject: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb]
Next
From: manojk.softengineer@gmail.com
Date:
Subject: BUG #6345: "forget the password for reinstallaion"