#!/usr/bin/perl use strict; use warnings; # Decode source from UTF-8. use utf8; # Decode STDIN as per locale. # Encode STDOUT & STDERR as per locale. use open qw( :std :locale ); my $test = '...'; print($test); Dump($test); #### #!/usr/bin/perl use strict; use warnings; # Decode source from UTF-8. use utf8; # Expect UTF-8 from STDIN. # Send UTF-8 to STDOUT & STDERR. BEGIN { binmode STDIN, ':encoding(UTF-8)' or die; binmode STDOUT, ':encoding(UTF-8)' or die; binmode STDERR, ':encoding(UTF-8)' or die; } my $test = '...'; print($test); Dump($test);