mldvx4 has asked for the wisdom of the Perl Monks concerning the following question:
I notice that /dev/stdout is not available to all users on some systems.
#!/usr/bin/perl use utf8; use strict; use warnings; open (OUT, ">:utf8", '/dev/stdout') or die("Could not open file 'stdout' : error: $!\n"); print OUT "åäöfoo\n"; close(OUT);
I am hoping to find a work-around or even a correct solution. The following only functions when use strict; has been removed.
#!/usr/bin/perl use utf8; use strict; use warnings; open (OUT, ">:utf8", STDOUT) or die("Could not open file 'stdout' : error: $!\n"); print OUT "åäöfoo\n"; close(OUT);
What would be the right approach to implement similar results?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Forcing UTF-8 output on STDOUT
by choroba (Cardinal) on Feb 10, 2021 at 19:36 UTC | |
by ikegami (Patriarch) on Feb 11, 2021 at 06:21 UTC | |
by mldvx4 (Hermit) on Feb 12, 2021 at 11:27 UTC | |
by mldvx4 (Hermit) on Feb 11, 2021 at 17:14 UTC | |
by choroba (Cardinal) on Feb 11, 2021 at 17:16 UTC | |
|