diff options
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; |