Re: LWP content encode

2008-09-15 Thread Bjoern Hoehrmann
* stefano tacconi wrote:
I'm writing a simple script to download some web pages on the net.
Using LWP it's works fine, but how can I get html page with strange
characher?

You are probably looking for HTML::Encoding, the script in the synopsis
shows how to decode the content; HTTP::Response::Encoding seems to be a
rather crude module that is unaware of HTML semantics.
-- 
Björn Höhrmann · mailto:[EMAIL PROTECTED] · http://bjoern.hoehrmann.de


LWP content encode

2008-09-15 Thread stefano tacconi
Hi List,

I'm writing a simple script to download some web pages on the net.
Using LWP it's works fine, but how can I get html page with strange
characher?

For example LWP doesn't get page with on-demand† string
(on-demand%C3%A2%C2%80%C2%9D).

I tried in vain with Encode, HTTP::Response::Encoding.

if ($res-is_success){
 my $html_content = $res-content;
 #my $html_content = $res-decoded_content;
 #my $html_content = encode( 'utf8', $res-decoded_content );
 my $html_content = uri_escape_utf8($res-content);
...
...

LWP returns half pages, untile it finds a strange character.

Any suggestions?

S.T.

p.s. I read jerakeen.org/files/2005/perl-utf8.slides.pdf documentation but
I've some problem again... :)