sid_com
sid_com

Reputation: 25117

WWW::Mechanize: save_content-encoding-question

Is there a way to influence the encoding of the save_content()-method from WWW::Mechanize?

Upvotes: 0

Views: 405

Answers (2)

sid_com
sid_com

Reputation: 25117

or I could write it this way

open my $fh, '>:encoding(utf-8)', $file_name or die $!; 
my $res = $mech->get( $url, ':content_cb' => sub{ print $fh shift } );

Upvotes: 0

cjm
cjm

Reputation: 62099

No. If you need to do that, open a file yourself (specifying whatever encoding you want) and print $mech->content to it.

Upvotes: 2

Related Questions