develooper Front page | perl.perl5.porters | Postings from September 2014

[perl #122551] Should work with utf-8 characters

From:
Serhij Krajko via RT
Date:
September 18, 2014 16:21
Subject:
[perl #122551] Should work with utf-8 characters
Message ID:
rt-4.0.18-4175-1411057286-957.122551-15-0@perl.org
On Thu Aug 21 14:00:54 2014, khw wrote:
> On Sun Aug 17 11:34:26 2014, krajserg@gmail.com wrote:
> > Hello,
> >
> > I'm very happy to see this prompt handles arrows and other traversing
> > the input string. However, often we need to enter Unicode characters
> > (encoded as utf-8 of course). Currently you just get a ? for each
> > character that makes up the character in utf-8.
> 
> You haven't included enough information for anyone to understand what
> the problem is?  What prompt are you referring to?  You don't mention
> what program you are running.  If it is perl, we need the output of
> 'perl -v' to better understand the situation.
> 
> Please give a step-by-step procedure of how to reproduce the problem





➜  ~  perl -v

This is perl 5, version 14, subversion 2 (v5.14.2) built for i486-linux-gnu-thread-multi-64int
(with 88 registered patches, see perl -V for more detail)

Copyright 1987-2011, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


➜  ~  locale
LANG=uk_UA.utf8
LANGUAGE=uk_UA.utf8:ru_UA.utf8
LC_CTYPE=uk_UA.utf8
LC_NUMERIC="uk_UA.utf8"
LC_TIME="uk_UA.utf8"
LC_COLLATE="uk_UA.utf8"
LC_MONETARY="uk_UA.utf8"
LC_MESSAGES="uk_UA.utf8"
LC_PAPER="uk_UA.utf8"
LC_NAME="uk_UA.utf8"
LC_ADDRESS="uk_UA.utf8"
LC_TELEPHONE="uk_UA.utf8"
LC_MEASUREMENT="uk_UA.utf8"
LC_IDENTIFICATION="uk_UA.utf8"
LC_ALL=


[CODE]
use Term::ReadLine;
my $term = Term::ReadLine->new('Test');
my $prompt = "Enter utf8 symbol: ";
$term->readline($prompt);
[/CODE]


Enter utf8 symbol: жузель

in fact, it turns out:

Enter utf8 symbol: ??????

In debian after installing the package libterm-readline-gnu-perl problem is gone 


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=122551



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About