[interchange/parsing-improvements] Catch another case with UTF8 flag flipping seen in the wild
David Christensen <[email protected]> Fri, 17 Nov 2017 19:43:24 +0000
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit a243278912f021a9c6da3b0fc9b889d3b7de42b3 Author: David Christensen <[email protected]> Date: Fri Nov 17 13:42:56 2017 -0600 Catch another case with UTF8 flag flipping seen in the wild lib/Vend/Interpolate.pm | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) --- diff --git a/lib/Vend/Interpolate.pm b/lib/Vend/Interpolate.pm index a71b889..8e65a1e 100644 --- a/lib/Vend/Interpolate.pm +++ b/lib/Vend/Interpolate.pm @@ -665,6 +665,12 @@ sub interpolate_html { vars_and_comments(\$html) unless $opt and $opt->{onfly}; + # catch potential flipped UTF8 flag from vars_and_comments + if (utf8::is_utf8($html)) { + $was_utf8 = 1; + Encode::_utf8_off($html) + } + $^W = 1 if $::Pragma->{perl_warnings_in_page}; # Returns, could be recursive