diff options
author | Norbert Preining <norbert@preining.info> | 2023-04-12 03:01:14 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-04-12 03:01:14 +0000 |
commit | 45c7bac9080d91b53c686e776fc6217d7f139b86 (patch) | |
tree | 9dd0ad4713ddbc97580545398e8a3c84ac52bf49 /support/latexindent/LatexIndent | |
parent | e6c62f5e4d4a4d5ab654dad1652e83a5a4a42891 (diff) |
CTAN sync 202304120301
Diffstat (limited to 'support/latexindent/LatexIndent')
-rw-r--r-- | support/latexindent/LatexIndent/Document.pm | 8 | ||||
-rw-r--r-- | support/latexindent/LatexIndent/FileExtension.pm | 13 | ||||
-rw-r--r-- | support/latexindent/LatexIndent/LogFile.pm | 9 | ||||
-rw-r--r-- | support/latexindent/LatexIndent/Version.pm | 4 |
4 files changed, 16 insertions, 18 deletions
diff --git a/support/latexindent/LatexIndent/Document.pm b/support/latexindent/LatexIndent/Document.pm index 4a99721a34..16a01bf209 100644 --- a/support/latexindent/LatexIndent/Document.pm +++ b/support/latexindent/LatexIndent/Document.pm @@ -240,15 +240,7 @@ sub output_indented_text { } elsif ( $switches{outputToFile} ) { - # diacritics in file names (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439) - # - # note, related: - # - # git config --add core.quotePath false - ${$self}{outputToFile} = decode( "utf-8", ${$self}{outputToFile} ); - $logger->info("Outputting to file ${$self}{outputToFile}"); - open( OUTPUTFILE, ">", ${$self}{outputToFile} ); print OUTPUTFILE ${$self}{body}; close(OUTPUTFILE); diff --git a/support/latexindent/LatexIndent/FileExtension.pm b/support/latexindent/LatexIndent/FileExtension.pm index b0f49f246d..b61ffc1bb4 100644 --- a/support/latexindent/LatexIndent/FileExtension.pm +++ b/support/latexindent/LatexIndent/FileExtension.pm @@ -21,6 +21,7 @@ use PerlIO::encoding; use open ':std', ':encoding(UTF-8)'; use File::Basename; # to get the filename and directory path use Exporter qw/import/; +use Encode qw/decode/; use LatexIndent::GetYamlSettings qw/%mainSettings/; use LatexIndent::Switches qw/%switches $is_check_switch_active/; use LatexIndent::LogFile qw/$logger/; @@ -114,7 +115,12 @@ sub file_extension_check { $logger->info("*-o switch active: output file check"); - ${$self}{outputToFile} = $switches{outputToFile}; + # diacritics in file names (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439) + # + # note, related: + # + # git config --add core.quotePath false + ${$self}{outputToFile} = decode( "utf-8", $switches{outputToFile} ); if ( $fileName eq "-" and $switches{outputToFile} =~ m/^\+/ ) { $logger->info("STDIN input mode active, -o switch is removing all + symbols"); @@ -124,7 +130,7 @@ sub file_extension_check { # the -o file name might begin with a + symbol if ( $switches{outputToFile} =~ m/^\+(.*)/ and $1 ne "+" ) { $logger->info("-o switch called with + symbol at the beginning: ${$self}{outputToFile}"); - ${$self}{outputToFile} = ${$self}{baseName} . $1; + ${$self}{outputToFile} = decode( "utf-8", ${$self}{baseName} . $1 ); $logger->info("output file is now: ${$self}{outputToFile}"); } @@ -137,7 +143,8 @@ sub file_extension_check { # if there is no extension, then add the extension from the file to be operated upon if ( !$ext ) { - $logger->info("-o switch called with file name without extension: $switches{outputToFile}"); + $logger->info( + "-o switch called with file name without extension: " . decode( "utf-8", $switches{outputToFile} ) ); ${$self}{outputToFile} = $name . ( $name =~ m/\.\z/ ? q() : "." ) . $strippedFileExtension; $logger->info( "Updated to ${$self}{outputToFile} as the file extension of the input file is $strippedFileExtension"); diff --git a/support/latexindent/LatexIndent/LogFile.pm b/support/latexindent/LatexIndent/LogFile.pm index 93b6ad0930..5847ca42f4 100644 --- a/support/latexindent/LatexIndent/LogFile.pm +++ b/support/latexindent/LatexIndent/LogFile.pm @@ -129,12 +129,9 @@ ENDQUOTE # cruft directory ${$self}{cruftDirectory} = $switches{cruftDirectory} || ( dirname ${$self}{fileName} ); - # diacritics in cruft directory (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439) - ${$self}{cruftDirectory} = decode( "utf-8", ${$self}{cruftDirectory} ); - # if cruft directory does not exist if ( !( -d ${$self}{cruftDirectory} ) ) { - $logger->fatal("*Could not find directory ${$self}{cruftDirectory}"); + $logger->fatal( "*Could not find directory " . decode( "utf-8", ${$self}{cruftDirectory} ) ); $logger->fatal("Exiting, no indentation done."); $self->output_logfile(); exit(6); @@ -143,6 +140,8 @@ ENDQUOTE my $logfileName = ( $switches{cruftDirectory} ? ${$self}{cruftDirectory} . "/" : '' ) . ( $switches{logFileName} || "indent.log" ); + $logfileName = decode( "utf-8", $logfileName ); + # details of the script to log file $logger->info("*$FindBin::Script version $versionNumber, $versionDate, a script to indent .tex files"); $logger->info("$FindBin::Script lives here: $FindBin::RealBin/"); @@ -247,7 +246,7 @@ ENDQUOTE } $logger->info("*Directory for backup files and $logfileName:"); - $logger->info("${$self}{cruftDirectory}"); + $logger->info( $switches{cruftDirectory} ? decode( "utf-8", ${$self}{cruftDirectory} ) : ${$self}{cruftDirectory} ); # output location of modules if ( $FindBin::Script eq 'latexindent.pl' or ( $FindBin::Script eq 'latexindent.exe' and $switches{trace} ) ) { diff --git a/support/latexindent/LatexIndent/Version.pm b/support/latexindent/LatexIndent/Version.pm index 457e9c83bf..998d3dbfe3 100644 --- a/support/latexindent/LatexIndent/Version.pm +++ b/support/latexindent/LatexIndent/Version.pm @@ -20,6 +20,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.20.5'; -our $versionDate = '2023-04-07'; +our $versionNumber = '3.20.6'; +our $versionDate = '2023-04-11'; 1 |