in reply to HTTP::Response decoded_content catch 22
my $html_file = encode( 'ASCII', $response->decoded_content(), Encode::FB_HTMLCREF ); my $tree = HTML::TreeBuilder->new(); $tree->parse($html_file);
and use utf8::decode on everything extracted from the tree if necessary.
It has the advantage of handling multiple byte encoding if HTML::Parser doesn't, and one knows which encoding to use when decoding data extracted from the tree.
|
|---|