我正在使用
my $ua = new LWP::UserAgent;
$ua->agent("Mozilla/5.0 (Windows NT 6.1; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20100101 Firefox/7.0.1 ");
my $url = "http://somedomain.com/page/";
my $req = new HTTP::Request 'GET' => $url;
$req->header('Accept' => 'text/html');
my $response = $ua->request($req);
my $html = $response->decoded_content;
获取网页。在这个页面上,Abobo's Big Adventure
出现。在$request->content
和$request->decoded_content
中,这显示为Abobo's Big Adventure
。
我可以做些什么来正确解码吗?