Please apply these two patches, which should fix the UTF-8 characters in
the font names, and prevent the zombie process, and let me know if the
problem with the delay still occurs.

Regards

Jeff
diff --git a/lib/Gscan2pdf/Dialog/Save.pm b/lib/Gscan2pdf/Dialog/Save.pm
index 04fac57b..e4ee5def 100644
--- a/lib/Gscan2pdf/Dialog/Save.pm
+++ b/lib/Gscan2pdf/Dialog/Save.pm
@@ -11,6 +11,7 @@ use Gscan2pdf::EntryCompletion;
 use Gscan2pdf::Translation '__';    # easier to extract strings with xgettext
 use Date::Calc qw(Today Today_and_Now);
 no if $] >= 5.018, warnings => 'experimental::smartmatch';
+use Encode;
 use Readonly;
 Readonly my $ENTRY_WIDTH_DATE     => 10;
 Readonly my $ENTRY_WIDTH_DATETIME => 19;
@@ -809,6 +810,7 @@ sub add_pdf_options {
     my @fonts;
     my ( undef, $stdout ) =
       Gscan2pdf::Document::exec_command( ['fc-list : family style file'] );
+    $stdout = Encode::decode_utf8($stdout);
 
     my $font = $self->get('pdf-font');
     for ( split /\n/sm, $stdout ) {
-- 
2.17.1

diff --git a/lib/Gscan2pdf/Document.pm b/lib/Gscan2pdf/Document.pm
index cc77f491..3e3e76ae 100644
--- a/lib/Gscan2pdf/Document.pm
+++ b/lib/Gscan2pdf/Document.pm
@@ -1980,7 +1980,9 @@ sub exec_command {
         close $fh or return $PROCESS_FAILED;
     }
 
-    waitpid $ALL_PENDING_ZOMBIE_PROCESSES, WNOHANG;
+    # Using 0 for flags, rather than WNOHANG to ensure that we wait for the
+    # process to finish and not leave a zombie
+    waitpid $ALL_PENDING_ZOMBIE_PROCESSES, 0;
     my $child_exit_status = $CHILD_ERROR >> $BITS_PER_BYTE;
     return $child_exit_status, slurp($reader), slurp($err);
 }
-- 
2.17.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to