Term :: Readline: encoding-question

When I enter "Müller", "M ?? ller" appears on the screen. How can i fix this?

#!/usr/bin/env perl use warnings; use 5.012; use Term::ReadLine; my $term = Term::ReadLine->new( 'dummy' ); my $con = $term->readline( ': ' ); say $con; # On the screen: # : M  ller # Müller 
+4
source share
1 answer

Apply the :utf8 layer to the STDIN and STDOUT file descriptors and pass them as arguments to Term::ReadLine->new() :

 binmode STDIN, ':utf8'; binmode STDOUT, ':utf8'; my $term = Term::ReadLine->new( 'dummy', \*STDIN, \*STDOUT ); 
+7
source

Source: https://habr.com/ru/post/1339320/


All Articles