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


in reply to Excel and Win32::Clipboard

I suspect that the text is not encoded as UTF-8 but Latin-1, so decoding your text from that most likely helps:

use Encode 'decode'; ... my $text = $clip->Get(); $text = decode('Latin1', $text); open my $fh2,'>', $ofile or die "Error opening output file $ofile: $!\ +n"; binmode $fh2, ":encoding(UTF-8)"; print $fh2 $text, "\n";

If that doesn't work out, consider posting the actual hex bytes of $text and the (HTML-encoded, for this site) text you expect. Maybe it is UCS-2 or UTF-16...