How do I treat the elements of @ARGV as UTF-8 in Perl?
Currently I\'m using the following work-around ..
use Encode qw(decode encode);
For example for windows set code
chcp 1251
in perl:
use utf8;
use Modern::Perl;
use Encode::Locale qw(decode_argv);
if (-t)
{
binmode(STDIN, ":encoding(console_in)");
binmode(STDOUT, ":encoding(console_out)");
binmode(STDERR, ":encoding(console_out)");
}
Encode::Locale::decode_argv();
in command line
perl -C ppixregexplain.pl qr/\bмама\b/i > ex1.html 2>&1
where ppixregexplain.pl