Help for this page

Select Code to Download


  1. or download this
    open(my $fh, '<:encoding(UTF-8)')
       or die;
    
  2. or download this
    binmode(STDIN, ':encoding(UTF-8)');
    
  3. or download this
    use Encode qw( decode );
    my $line_bytes = <$fh>;
    my $line_chars = decode('UTF-8', $line_bytes);