texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/Convert/Converter.pm (txt_image_text


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/Converter.pm (txt_image_text): decode file name for error messages.
Date: Sat, 22 Jul 2023 06:24:53 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 90f002a1b7 * tp/Texinfo/Convert/Converter.pm (txt_image_text): decode 
file name for error messages.
90f002a1b7 is described below

commit 90f002a1b72ea8ceb1bed7e79ba76b56846e3cdc
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jul 22 12:24:41 2023 +0200

    * tp/Texinfo/Convert/Converter.pm (txt_image_text): decode file name
    for error messages.
---
 ChangeLog                       |  5 +++++
 tp/Texinfo/Convert/Converter.pm | 10 ++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2f28e72076..c972d522f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-07-22  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/Converter.pm (txt_image_text): decode file name
+       for error messages.
+
 2023-07-22  Patrice Dumas  <pertusus@free.fr>
 
        * tp/tests/encoded/osé_utf8_no_setfilename.texi: synchronize with
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index 4e0a5fd89d..bf266f66a5 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -1226,15 +1226,21 @@ sub txt_image_text($$$)
       # remove last end of line
       chomp ($result);
       if (!close ($filehandle)) {
+        my $decoded_file = $txt_file;
+        $decoded_file = Encode::decode($file_name_encoding, $txt_file)
+          if (defined($file_name_encoding));
         $self->document_warn($self,
            sprintf(__("error on closing image text file %s: %s"),
-                                     $txt_file, $!));
+                                     $decoded_file, $!));
       }
       return ($result, $max_width);
     } else {
+      my $decoded_file = $txt_file;
+      $decoded_file = Encode::decode($file_name_encoding, $txt_file)
+        if (defined($file_name_encoding));
       $self->line_warn($self,
                   sprintf(__("\@image file `%s' unreadable: %s"),
-                               $txt_file, $!), $element->{'source_info'});
+                             $decoded_file, $!), $element->{'source_info'});
     }
   }
   return undef;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]