use Getopt::Long;
use Encode;
use UUID;
-#use encoding 'utf-8';
+use utf8;
binmode(STDOUT, ":utf8");
my $haveimagick = eval { require Image::Magick; };
}
my $term = new Term::ReadLine "Edit Title";
+binmode($term->IN, ':utf8');
FsObj->new(getcwd)->iterate;
my $titleimage;
my $T;
my $TI;
- if (open($T,'<'.$fullpath.'/.title')) {
- binmode($T, ":utf8");
+ if (open($T,'<:encoding(utf8)', $fullpath.'/.title')) {
$title = <$T>;
$title =~ s/[\r\n]*$//;
close($T);
print $OUT "Enter title for $fullpath\n";
$title = $term->readline($prompt.' >',$title);
$term->addhistory($title) if ($title);
- if (open($T,'>'.$fullpath.'/.title')) {
+ if (open($T,'>:encoding(utf8)', $fullpath.'/.title')) {
print $T $title,"\n";
close($T);
}
$title=$self->{-relpath};
}
$self->{-title}=$title;
- if (open($TI,'<'.$fullpath.'/.titleimage')) {
- binmode($TI, ":utf8");
+ if (open($TI,'<:encoding(utf8)', $fullpath.'/.titleimage')) {
$titleimage = <$TI>;
$titleimage =~ s/[\r\n]*$//;
close($TI);
$toggletext = 'Play->';
}
my $F;
- unless (open($F,'>'.$fn)) {
+ unless (open($F,'>:encoding(utf8)', $fn)) {
warn "cannot open \"$fn\": $!";
next;
}
- binmode($F, ":utf8");
if ($refresh eq 'slide') {
print $F start_html(
-encoding=>"utf-8",
my $fn = sprintf("%s/.html/%s-info.html",$dn,$name);
if (isnewer($self->{-fullpath},$fn)) {
my $F;
- unless (open($F,'>'.$fn)) {
+ unless (open($F,'>:encoding(utf8)', $fn)) {
warn "cannot open \"$fn\": $!";
return;
}
- binmode($F, ":utf8");
my $imgsrc = sprintf("../.%s/%s",$sizes[0],$name);
print $F start_html(-title=>$title,
-encoding=>"utf-8",
my $block = $self->{-fullpath}.'/.noindex';
$fn = '/dev/null' if ( -f $block );
my $IND;
- unless (open($IND,'>'.$fn)) {
+ unless (open($IND,'>:encoding(utf8)', $fn)) {
warn "cannot open $fn: $!";
return;
}
- binmode($IND, ":utf8");
$self->{-IND} = $IND;
my $inc = $self->{-inc}.$incdir.'/';
-id => 'indexContainer'}),
"\n";
my $EVL;
- if (open($EVL,$self->{-toppath}.'/'.$incdir.'/header.pl')) {
+ if (open($EVL, '<:encoding(utf8)', $self->{-toppath}.'/'.$incdir.'/header.pl')) {
my $prm;
while (<$EVL>) {
$prm .= $_;
print $IND end_div;
my $EVL;
- if (open($EVL,$self->{-toppath}.'/'.$incdir.'/footer.pl')) {
+ if (open($EVL, '<:encoding(utf8)', $self->{-toppath}.'/'.$incdir.'/footer.pl')) {
my $prm;
while (<$EVL>) {
$prm .= $_;