in reply to Forcing UTF-8 output on STDOUT
Do you really want to send the output to a file named STDOUT?
If not, use binmode instead of open:
#!/usr/bin/perl use utf8; use strict; use warnings; binmode *STDOUT, ':utf8'; print "åäöfoo\n";
Using :encoding(UTF-8) instead of :utf8 would turn on some useful checking, too.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Forcing UTF-8 output on STDOUT
by ikegami (Patriarch) on Feb 11, 2021 at 06:21 UTC | |
Re^2: Forcing UTF-8 output on STDOUT
by mldvx4 (Friar) on Feb 12, 2021 at 11:27 UTC | |
Re^2: Forcing UTF-8 output on STDOUT
by mldvx4 (Friar) on Feb 11, 2021 at 17:14 UTC | |
by choroba (Cardinal) on Feb 11, 2021 at 17:16 UTC | |
|
In Section
Seekers of Perl Wisdom