http://www.perlmonks.org?node_id=928170


in reply to Re^3: MediaWiki::API->upload() problem
in thread MediaWiki::API->upload() problem

Any decode functions don't work.

$response return code of data in image format, i. e. png, jpg

Some examples:

$response = $response->content() if($response->is_success()); die Dumper($response);
$ perl test.pl $VAR1 = '&#9618;PNG IHD&#9618;6n&#9618;sRGB&#9618;&#9618;&#9618;gAMA&#9618;&#9618; &#9618;a cHRMz&&#9618;&#9618;&#9618;&#9618;&#9618; +u0&#9618;`:&#9618;p&#9618;&#9618;Q<!IDATWc&#9618; &#9618;*1&#9618;&#9618;Ig&#9618; &#9618;&#9618;&#9618;+(&#9618;&#9618;K&#9618;&&#1432;IEND&#9618;B`&#96 +18;';
$response = $response->decoded_content() if($response->is_success()); die Dumper($response);
$ perl test.pl $VAR1 = '&#9618;PNG IHD&#9618;6n&#9618;sRGB&#9618;&#9618;&#9618;gAMA&#9618;&#9618; &#9618;a cHRMz&&#9618;&#9618;&#9618;&#9618;&#9618; +u0&#9618;`:&#9618;p&#9618;&#9618;Q<!IDATWc&#9618; &#9618;*1&#9618;&#9618;Ig&#9618; &#9618;&#9618;&#9618;+(&#9618;&#9618;K&#9618;&&#1432;IEND&#9618;B`&#96 +18;';
$response = $response->content() if($response->is_success()); $response = utf8::downgrade($response); die Dumper($response);
$ perl test.pl $VAR1 = 1;
Probably, needs to use some specific libs for work with it?