Help for this page

Select Code to Download


  1. or download this
        open my $fh, '<:encoding(UTF-8)', $filename
            or die "Couldn't open '$filename': $!";
    
  2. or download this
        open my $fh, '>:encoding(UTF-8)', $filename
            or die "Couldn't open '$filename': $!";
    
  3. or download this
    use charnames ':full';
    use Encode 'encode';
    ...
    my $output = "MOT\N{CAPITAL LETTER O WITH DIAERESIS}RHEAD";
    my $output_bytes = encode( 'UTF-8', $output );
    print $fh $output_bytes;