Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: reading Unicode from Excel

by ddn123456 (Pilgrim)
on Apr 29, 2008 at 13:03 UTC ( [id://683456]=note: print w/replies, xml ) Need Help??


in reply to Re^3: reading Unicode from Excel
in thread reading Unicode from Excel

Hi,

It's "easier" to parse unicode excel files with this decoding via perl 5.8.X or higher.

open(FH, "<:raw:encoding(UTF16-LE):utf8", $File_UTF_MS);

With this line you order excel to save files in UTF16-LE.
$Excel->{DisplayAlerts} = 'False'; $xlWorkBook->SaveAs( $File_UTF_MS, $xlConst->{'xlUnicodeText'});

With this line you write in UTF8.
open(FH, ">utf8", $File_UTF8);

This because our dear MS friends make use of UTF-16.
Cf. http://blogs.msdn.com/brettsh/archive/2006/06/07/620986.aspx
Therefore you need to convert from raw to utf16 to utf8.
Kind regards.
ddn123456

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2025-11-15 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (72 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.