Subject: | clobbers binmode layers on filehandles |
Date: | Thu, 29 Jul 2010 20:28:35 +0200 |
To: | bug-Term-ReadLine-Gnu [...] rt.cpan.org |
From: | Salvatore Bonaccorso <carnil [...] cpan.org> |
Hi
In Debian we recieved the following bugreport. Could you have a look
at it?
Many thanks in advance
Bests
Salvatore
------------------------------------------------------------------------
From: Andrew Pimlott <andrew@pimlott.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libterm-readline-gnu-perl: clobbers binmode layers on filehandles
Date: Thu, 17 Sep 2009 13:31:24 -0700
Package: libterm-readline-gnu-perl
Version: 1.19-1
Severity: normal
If I call
Term::ReadLine->new('test', \*IN, \*OUT);
any encoding layers I have set on OUT seem to be removed. I tracked it
down to the line in the perl source that sets $Attribs{outstream}. I
looked briefly at the .xs source for _rl_store_iostream, but I can't see
what's causing this. I hope someone who knows perl internals can figure
it out.
Here's a complete test program. I run it on a utf-8 terminal. The
first print works correctly (the correct utf-8 byte sequence is output),
and the second shows a unicode unknown character (U+fffd), because perl
outputs the byte \xf3.
use Term::ReadLine;
binmode(STDOUT, ':encoding(utf-8)');
print STDOUT ">", chr(0xf3), "<\n";
$Term::ReadLine::Gnu::Attribs{outstream} = \*STDOUT;
print STDOUT ">", chr(0xf3), "<\n";
Andrew
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.30-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libterm-readline-gnu-perl depends on:
ii libc6 2.9-26 GNU C Library: Shared libraries
ii libncurses5 5.7+20090803-2 shared libraries for terminal hand
ii libreadline5 5.2-6 GNU readline and history libraries
ii perl 5.10.0-25 Larry Wall's Practical Extraction
ii perl-base [perlapi-5.10.0 5.10.0-25 minimal Perl system
libterm-readline-gnu-perl recommends no packages.
libterm-readline-gnu-perl suggests no packages.
-- no debconf information
------------------------------------------------------------------------
Message body not shown because it is not plain text.