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

Re: BUG #6344: Trouble with plperl

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: k_denisov(at)inbox(dot)ru
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6344: Trouble with plperl
Date: 2011-12-19 00:35:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
On Sun, Dec 18, 2011 at 01:25,  <k_denisov(at)inbox(dot)ru> wrote:
> The following bug has been logged on the website:
> Bug reference:      6344
> Logged by:          Kirill
> Email address:      k_denisov(at)inbox(dot)ru
> PostgreSQL version: 9.1.2
> Operating system:   Linux Debian
> Description:
> plperl function:
> open(FILE,">>/test/test.txt");
> print FILE "Проверка(Cyrillic text)";
> 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)


use Encode qw(encode);
my $str =decode("cp1251", "Проверка(Cyrillic text));
print FILE $str;

In response to

pgsql-bugs by date

Next:From: manojk.softengineerDate: 2011-12-19 05:19:39
Subject: BUG #6345: "forget the password for reinstallaion"
Previous:From: Martin PittDate: 2011-12-18 22:42:03
Subject: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb]

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