File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 187
187
$this -> {cacheDir } . ' /' . $variation -> {md5 } );
188
188
189
189
# writeDebug("saving data of $webTopic into $fileName");
190
- open ( $FILE , ' >' , $fileName ) or die " Can't create file $fileName - $! \n " ;
190
+ open ( $FILE , ' >:encoding(utf-8)' , $fileName )
191
+ or die " Can't create file $fileName - $! \n " ;
191
192
print $FILE $variation -> {data };
192
193
close ($FILE );
193
194
225
226
if ( defined $variation ) {
226
227
my $FILE ;
227
228
my $fileName = $this -> {cacheDir } . ' /' . $variation -> {md5 };
228
- open ( $FILE , ' <' , $fileName ) or return ;
229
+ open ( $FILE , ' <:encoding(utf-8) ' , $fileName ) or return ;
229
230
local $/ = undef ;
230
231
$variation -> {data } = <$FILE >;
231
232
close ($FILE );
Original file line number Diff line number Diff line change @@ -586,7 +586,7 @@ sub _readFile {
586
586
my ( $session , $fn ) = @_ ;
587
587
my $F ;
588
588
589
- if ( open ( $F , ' <' , $fn ) ) {
589
+ if ( open ( $F , ' <:encoding(utf-8) ' , $fn ) ) {
590
590
local $/ ;
591
591
my $text = <$F >;
592
592
close ($F );
@@ -624,7 +624,7 @@ sub saveTemplateToCache {
624
624
my $filename = Foswiki::Sandbox::untaintUnchecked(
625
625
$tmpl_cachedir . ' /' . $name . ' __' . $skins . ' __' . $web . ' .tmpl' );
626
626
627
- open ( my $file , ' >' , $filename ) or do {
627
+ open ( my $file , ' >:encoding(utf-8) ' , $filename ) or do {
628
628
die " Can't create file $filename - $! \n " if DEBUG;
629
629
print STDERR " Can't create file $filename - $! \n " ;
630
630
@@ -646,7 +646,7 @@ sub getTemplateFromCache {
646
646
$tmpl_cachedir . ' /' . $name . ' __' . $skins . ' __' . $web . ' .tmpl' );
647
647
648
648
if ( -e $filename ) {
649
- open ( my $in_file , ' <' , $filename ) or return ;
649
+ open ( my $in_file , ' <:encoding(utf-8) ' , $filename ) or return ;
650
650
local $/ = undef ; # set to read to EOF
651
651
my $data = <$in_file >;
652
652
close ($in_file );
You can’t perform that action at this time.
0 commit comments