- or download this
my $text = "\xCE\xA9"; # Omega, UTF-8 encoded
...
open FH, ">:utf8", "myfile" or die $!;
print FH $text; # wrong: C3 8E C2 A9
- or download this
use Encode;
...
open FH, ">:utf8", "myfile" or die $!;
print FH $text; # OK
- or download this
use Encode;
...
open FH, ">:utf8", "myfile" or die $!;
print FH $text; # OK
- or download this
my $text = "\xCE\xA9";
...
open FH, ">", "myfile" or die $!; # no PerlIO encoding layer
print FH $text; # OK
- or download this
print "is Omega" if $text =~ /\x{03A9}/; # doesn't match!