aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-04-10 23:53:18 +1200
committerDavid Phillips <david@sighup.nz>2018-04-10 23:53:18 +1200
commitf53e5933315a316bb94d8d27cebbb95554aca6ba (patch)
tree8fb3529043887a338eca649a746b7466cb504ca7
parenta5316e514b05f8f0bb9dc745ede654a968e41cc1 (diff)
downloadidalius-f53e5933315a316bb94d8d27cebbb95554aca6ba.tar.xz
Decode HTML body before passing to to head parser
From the HTML::HeadParser docs: > Note that the HTML::HeadParser might get confused if raw undecoded UTF-8 is > passed to the parse() method. Make sure the strings are properly decoded > before passing them on. This explains some hard-to-trace bugs with character mangling
-rw-r--r--Plugin/URL_Title.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/Plugin/URL_Title.pm b/Plugin/URL_Title.pm
index 495df8e..8248560 100644
--- a/Plugin/URL_Title.pm
+++ b/Plugin/URL_Title.pm
@@ -45,6 +45,7 @@ sub message
}
my $html = $response->{content};
+ utf8::decode($html);
my $parser = HTML::HeadParser->new;
$parser->parse($html);