…прочтите же, наконец, инструкцию…

Проблема с Eclipse решилась. Проблема, собственно, не с Eclipse была:

http://ahinea.com/en/tech/perl-unicode-struggle.html
Solution #2: Specify IO encoding layers for your filehandles

In Perl 5.8 a filehandle can have an encoding specified for it. Perl then will convert all input from the file automatically into its internal Unicode encoding. It will mark the values read from it accordingly with the utf8 flag. Equally, perl can convert output to a specific encoding for a filehandle. Additionally, perl checks that the data you output is valid for the filehandle’s encoding.

So, if you read data from a file or another input stream, and you expect UTF-8 data there, warn perl:

if ( open( FILE, "<:utf8 ", $fname ) ) {
. . .
}

or, in case of our simple test,

#!/usr/bin/perl

my $ustring1 = "Hello \x{263A}!\n";
binmode DATA, ":utf8";
my $ustring2 = ;

print "$ustring1$ustring2";
__DATA__
Hello ☺!


Posted

in

by