texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Avoid double encoding error messages with XS pars


From: Gavin D. Smith
Subject: branch master updated: Avoid double encoding error messages with XS parser
Date: Tue, 22 Feb 2022 15:36:53 -0500

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

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 0498254386 Avoid double encoding error messages with XS parser
0498254386 is described below

commit 04982543866422c7c48382085f822d13568880aa
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Feb 22 20:36:43 2022 +0000

    Avoid double encoding error messages with XS parser
    
    * tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_errors): Call
    utf8::decode before eval-ing error message output from XS parser.
---
 ChangeLog                            | 7 +++++++
 tp/Texinfo/XS/parsetexi/Parsetexi.pm | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 201fdb79e5..05fd7fea35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-02-22  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       Avoid double encoding error messages with XS parser
+
+       * tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_errors): Call
+       utf8::decode before eval-ing error message output from XS parser.
+
 2022-02-22  Gavin Smith  <gavinsmith0123@gmail.com>
 
        Fix test failures under non-English locale
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm 
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index 108495385e..f6f5485a45 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -254,6 +254,10 @@ sub _get_errors($)
 
   my $ERRORS;
   my $tree_stream = dump_errors();
+
+  # dump_errors outputs error messages in UTF-8 and we want to read them in
+  # as Perl strings
+  utf8::decode($tree_stream);
   eval $tree_stream;
   for my $error (@{$ERRORS}) {
     if ($error->{'type'} eq 'error') {



reply via email to

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