GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  WWW::MECHANIZE::DECODEDCONTENT (3)

.ds Aq ’

NAME

WWW::Mechanize::DecodedContent - decode Mech content using its HTTP response encoding

CONTENTS

SYNOPSIS



  use WWW::Mechanize;
  use WWW::Mechanize::DecodedContent;

  my $mech = WWW::Mechanize->new;
     $mech->get($url);

  my $content = $mech->decoded_content || $mech->content;



DESCRIPTION

WWW::Mechanize::DecodedContent is a plugin to add decoded_content utility method to WWW::Mechanize.

<B>NOTEB> If you’re using WWW::Mechanize 1.50 or later, just use $mech->content and it will return decoded content.

METHODS

res->encoding Because it loads HTTP::Response::Encoding module, it automatically adds encoding method to HTTP::Response class.



  my $enc = $mech->res->encoding;



Note that $enc might be empty if HTTP response header doesn’t contain valid charset attribute.

decoded_content


  my $content = $mech->decoded_content;



returns HTML as decoded using HTTP response encoding. Returns undef if encoding is not specified. In that case you might need to get the raw content using $mech->content, and decode it using the default encoding, which is likely to be iso-8859-1.

AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

HTTP::Response::Encoding, WWW::Mechanize
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 WWW::MECHANIZE::DECODEDCONTENT (3) 2008-11-23

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.