in reply to Re^2: TreeBuilder and encoding
in thread TreeBuilder and encoding
I think that you are working it a little to hard. There is no "utf-8", but there is ":utf8". I always use ":encoding(UTF-8)", just to be safe.
Here's what I did: If you use the new_from_url method, then it will call LWP::UserAgent for you.
use HTML::TreeBuilder 5 -weak;
my $tree = HTML::TreeBuilder->new_from_url( $url );
$tree->parse_content( $url );
my $review_et = $tree->look_down('itemprop', 'reviewBody');
binmode STDOUT, ":encoding(UTF-8)";