Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Excel and Win32::Clipboard

by Corion (Patriarch)
on Mar 25, 2020 at 21:13 UTC ( [id://11114649]=note: print w/replies, xml ) Need Help??


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...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11114649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-18 00:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found