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 (Pope)
on Mar 25, 2020 at 21:13 UTC ( #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
Node Status?
node history
Node Type: note [id://11114649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-05-29 11:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (169 votes). Check out past polls.

    Notices?