When we use the LWP to parse a page that is UTF-8 encoded, we get a warning of "Parsing of undecoded UTF-8 will give garbage when decoding entities at /usr/share/perl5/LWP/Protocol.pm line 114". This is documented in HTML::Parser's manual.
A simple way to get around this is to silent the warning like this:
BEGIN {
$SIG{'__WARN__'} =
sub {
warn $_[0]
if index($_[0], 'Parsing of undecoded UTF-8 will give garbage') < 0;
};
}
This sets a __WARN__ handler to output the warning only if the warning has nothing to do with "Parsing of undecoded UTF-8 will give garbage". You can check "perldoc -f warn" and "man perlvar" to get more information on this.
Recent comments
2 weeks 5 days ago
3 weeks 6 days ago
7 weeks 4 days ago
32 weeks 4 days ago
33 weeks 3 days ago
44 weeks 3 days ago
45 weeks 6 days ago
1 year 2 weeks ago
1 year 2 weeks ago
1 year 3 weeks ago