Same as any other:
my $content = $response->decoded_content();
That said, the iso-8859-1 charset does not include the Euro sign. You probably actually have cp1252. You can fix that as follows:
my $content = $response->decoded_content( charset => 'cp1252' );
Your second problem is that you don't encode your output. This is how you'd do it.
open(my $MYOUTFILE, '>>:encoding(cp1252)', 'D:\\encodingperl.html')
or die $!;
print $MYOUTFILE $content;
Use the encoding that's appropriate for you (e.g. UTF-8
) if it's not cp1252
you want. If you want the original file in the original encoding, use
my $content = $response->decoded_content( charset => 'none' );
and
open(my $MYOUTFILE, '>>', 'D:\\encodingperl.html')
or die $!;
binmode($MYOUTFILE);
print $MYOUTFILE $content;