Commits

Shlomi Fish  committed 85971aa

Avoid malformed UTF-8 warnings.

- Apply 0005-XML-LibXML-Error-avoid-malformed-UTF-8-warnings.patch
from https://rt.cpan.org/Public/Bug/Display.html?id=68575
-- Applied by SHLOMIF.
-- Thanks to Aaron Crane.

  • Participants
  • Parent commits 954654b

Comments (0)

Files changed (2)

       errors.
         -- Applied by SHLOMIF.
         -- Thanks to Aaron Crane.
-
-
+    - Apply 0005-XML-LibXML-Error-avoid-malformed-UTF-8-warnings.patch
+      from https://rt.cpan.org/Public/Bug/Display.html?id=68575
+        -- Applied by SHLOMIF.
+        -- Thanks to Aaron Crane.
 
 1.70
    - various fixes and improvements in the documentation

File lib/XML/LibXML/Error.pm

       $msg.=$self->{str1}."\n";
       $msg.=(" " x $self->{num1})."^\n";
     } elsif (defined $self->{context}) {
+      # If the error relates to character-encoding problems in the context,
+      # then doing textual operations on it will spew warnings that
+      # XML::LibXML can do nothing to fix.  So just disable all such
+      # warnings.  This has the pleasing benefit of making the test suite
+      # run warning-free.
+      no warnings 'utf8';
       my $context = $self->{context};
       $msg.=$context."\n";
       $context = substr($context,0,$self->{column});