Changeset 2244

Show
Ignore:
Timestamp:
05/09/07 18:49:35
Author:
miyagawa
Message:

treat as UTF-8 if there's no encoding found

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Web-Scraper/trunk/lib/Web/Scraper.pm

    r2242 r2244  
    4545 
    4646    if (blessed($stuff) && $stuff->isa('URI')) { 
     47        require Encode; 
    4748        require HTTP::Response::Encoding; 
    4849        my $ua  = __ua; 
    4950        my $res = $ua->get($stuff); 
    5051        if ($res->is_success) { 
    51             $html = $res->decoded_content
     52            $html = $res->encoding ? $res->decoded_content : Encode::decode_utf8($res->content)
    5253        } else { 
    5354            croak "GET $stuff failed: ", $res->status_line;