Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should work with utf-8 characters #14031

Closed
p5pRT opened this issue Aug 17, 2014 · 11 comments
Closed

Should work with utf-8 characters #14031

p5pRT opened this issue Aug 17, 2014 · 11 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 17, 2014

Migrated from rt.perl.org#122551 (status was 'rejected')

Searchable as RT122551$

@p5pRT
Copy link
Author

p5pRT commented Aug 17, 2014

From krajserg@gmail.com

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.

@p5pRT
Copy link
Author

p5pRT commented Aug 21, 2014

From @khwilliamson

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

--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented Aug 21, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2014

From @jkeenan

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

We haven't heard back from the original poster in a month. I recommend that we close this ticket in 7 days unless we get further input.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Sep 18, 2014

From krajserg@gmail.com

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

@p5pRT
Copy link
Author

p5pRT commented Oct 27, 2014

From @cpansprout

On Thu Sep 18 09​:21​:26 2014, krajserg@​gmail.com wrote​:

[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

It would be useful to know which ReadLine backend it was using. If you could uninstall the package temporarily and add​:

  warn "ReadLine library is ", $term->ReadLine;

to your code, the output would be helpful in figuring out why the question marks were showing up. (I cannot reproduce the problem on Mac OS X with the default Stub implementation.)

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Mar 8, 2016

From @khwilliamson

On Mon Oct 27 16​:04​:12 2014, sprout wrote​:

On Thu Sep 18 09​:21​:26 2014, krajserg@​gmail.com wrote​:

[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

It would be useful to know which ReadLine backend it was using. If
you could uninstall the package temporarily and add​:

warn "ReadLine library is ", $term->ReadLine;

to your code, the output would be helpful in figuring out why the
question marks were showing up. (I cannot reproduce the problem on
Mac OS X with the default Stub implementation.)

Again, it has been a very long time without a response from the OP, who said the problem goes away after installing libterm-readline-gnu-perl

I'm taking this ticket, and if in a month nothing further has been heard, I'll close it.
--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented Apr 8, 2016

From @khwilliamson

Closing this ticket as per the previous message, after a month with no further communication
--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented Apr 8, 2016

@khwilliamson - Status changed from 'open' to 'rejected'

@p5pRT p5pRT closed this as completed Apr 8, 2016
@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2016

From @Smylers

Father Chrysostomos via RT writes​:

On Thu Sep 18 09​:21​:26 2014, krajserg@​gmail.com wrote​:

[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

It would be useful to know which ReadLine backend it was using. If you could uninstall the package temporarily and add​:

warn "ReadLine library is "\, $term\->ReadLine;

to your code, the output would be helpful in figuring out why the
question marks were showing up. (I cannot reproduce the problem on
Mac OS X with the default Stub implementation.)

I'm not the original poster, but I can reproduce the problem on Ubuntu
with Term​::ReadLine​::Perl. It's fine with both the :​:Stub and :​:GNU back
ends.* Ostensibly, since Term​::ReadLine​::Perl is on Cpan, there's
nothing for P5P to do here. But ...

Does it still make sense for Term​::ReadLine (which is upstream blead)
ever to choose the :​:Perl back end? If it's worse than the provided
:​:Stub back end, maybe :​:Perl should only be chosen if explicitly
requested?

Term​::ReadLine​::Perl has 32 open bugs (not including this one), and its
most recent release was 2009​:
https://metacpan.org/release/Term-ReadLine-Perl

Term​::ReadLine (which is upstream blead) currently looks for back ends
in this order, using the first it finds​: Gnu, EditLine, Perl, Stub.

If :​:Perl were removed from that list, what would break? Whom would it
make things worse for?

Smylers

* For what it's worth, aptitude why libterm-readline-perl-perl reveals
  that lighttpd is the reason why I have the buggy module installed.

  Anybody wanting to play along, here's the code as a one-liner​:

  $ PERL_RL=Perl perl -MTerm​::ReadLine -wE 'Term​::ReadLine->new($0)->readline(q[Enter UTF-8 symbol​: ])'

  Typing a non-Ascii character displays a � instead. However, typing
  another character then backspacing over it causes all the preceding �
  symbols to suddenly turn into their intended characters.

--
http​://twitter.com/Smylers2

@p5pRT
Copy link
Author

p5pRT commented Apr 25, 2016

From @andk

On Thu, 21 Apr 2016 11​:47​:08 +0100, Smylers <Smylers@​stripey.com> said​:

  > Term​::ReadLine (which is upstream blead) currently looks for back ends
  > in this order, using the first it finds​: Gnu, EditLine, Perl, Stub.

  > If :​:Perl were removed from that list, what would break? Whom would it
  > make things worse for?

:​:Perl adds at least cursor movement. In the example you posted I can
type in a letter and move the cursor to the left and right. With
PERL_RL=​::Stub I add something like ^[[D when trying to go left.

--
andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant