View difference between Paste ID: wPNAbDdC and 2wzFFJPk
SHOW: | | - or go back to the newest paste.
1
use CGI qw( -utf8 );
2
use CGI::Carp qw(fatalsToBrowser);
3
use utf8;
4
5
$cgi=CGI->new();
6
7-
print $cgi->header();
7+
print $cgi->header(-type => 'text/html', -charset => 'utf-8');
8
9
$page        = $cgi->param('page');
10
$root_dir = "/home2/godspla1/public_html/romanian";
11
12
$root_dir =~ s|/$||; #get rid of trailing slash
13
14
open (RESULTS, "$root_dir/$page") 
15
  or die "Can't open results page ($root_dir/$page): $!";
16
binmode STDOUT, ":utf8";
17-
open (my $fh, ">:encoding(utf8)", "$root_dir/temp.txt" ) or die "Can't open file ($root_dir/temp.txt): $!";
17+
18
     print "ă\n";
19
}
20-
     print $fh "ă\n";
20+