pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6344: Trouble with plperl
2+ messages / 2 participants
[nested] [flat]

* BUG #6344: Trouble with plperl
@ 2011-12-18 08:25  k_denisov@inbox.ru
  0 siblings, 1 reply; 2+ messages in thread

From: k_denisov@inbox.ru @ 2011-12-18 08:25 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      6344
Logged by:          Kirill
Email address:      k_denisov@inbox.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.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #6344: Trouble with plperl
@ 2011-12-19 00:35  Alex Hunsaker <badalex@gmail.com>
  parent: k_denisov@inbox.ru
  0 siblings, 0 replies; 2+ messages in thread

From: Alex Hunsaker @ 2011-12-19 00:35 UTC (permalink / raw)
  To: k_denisov@inbox.ru; +Cc: 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:      6344
> Logged by:          Kirill
> Email address:      k_denisov@inbox.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)

or

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-12-19 00:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-12-18 08:25 BUG #6344: Trouble with plperl k_denisov@inbox.ru
2011-12-19 00:35 ` Alex Hunsaker <badalex@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox