diff options
author | Norbert Preining <norbert@preining.info> | 2023-04-08 03:01:13 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-04-08 03:01:13 +0000 |
commit | 24c6de40a2869f5b6c213c2cf69e597f885f2b19 (patch) | |
tree | 5225200910d14cb8b177fad2192b492f3b254e5c /support/latexindent/LatexIndent/BackUpFileProcedure.pm | |
parent | bd96eb3748479a2feb0e8a0ef06203de92766953 (diff) |
CTAN sync 202304080301
Diffstat (limited to 'support/latexindent/LatexIndent/BackUpFileProcedure.pm')
-rw-r--r-- | support/latexindent/LatexIndent/BackUpFileProcedure.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/support/latexindent/LatexIndent/BackUpFileProcedure.pm b/support/latexindent/LatexIndent/BackUpFileProcedure.pm index 82d1a81653..9f54207a57 100644 --- a/support/latexindent/LatexIndent/BackUpFileProcedure.pm +++ b/support/latexindent/LatexIndent/BackUpFileProcedure.pm @@ -23,6 +23,7 @@ use LatexIndent::LogFile qw/$logger/; use File::Basename; # to get the filename and directory path use File::Copy; # to copy the original file to backup (if overwrite option set) use Exporter qw/import/; +use Encode qw/decode/; our @EXPORT_OK = qw/create_back_up_file check_if_different/; # copy main file to a back up in the case of the overwrite switch being active @@ -35,7 +36,7 @@ sub create_back_up_file { # if we want to over write the current file create a backup first $logger->info("*Backup procedure (-w flag active):"); - my $fileName = ${$self}{fileName}; + my $fileName = decode( "utf-8", ${$self}{fileName} ); # grab the file extension preferences my %fileExtensionPreference = %{ $mainSettings{fileExtensionPreference} }; @@ -48,7 +49,7 @@ sub create_back_up_file { my $backupFile = basename( ${$self}{fileName}, @fileExtensions ); # add the user's backup directory to the backup path - $backupFile = "${$self}{cruftDirectory}/$backupFile"; + $backupFile = decode( "utf-8", "${$self}{cruftDirectory}/$backupFile" ); # local variables, determined from the YAML settings my $onlyOneBackUp = $mainSettings{onlyOneBackUp}; @@ -103,9 +104,9 @@ sub create_back_up_file { for ( my $i = 1; $i <= $maxNumberOfBackUps; $i++ ) { # remove number from backUpFile - my $oldBackupFile = $backupFile; + my $oldBackupFile = decode( "utf-8", $backupFile ); $oldBackupFile =~ s/$backupExtension.*/$backupExtension/; - my $newBackupFile = $oldBackupFile; + my $newBackupFile = decode( "utf-8", $oldBackupFile ); # add numbers back on $oldBackupFile .= $i; |