Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Problems parsing UTF16 file

by Khen1950fx (Canon)
on Aug 10, 2012 at 06:34 UTC ( #986675=note: print w/ replies, xml ) Need Help??


in reply to Problems parsing UTF16 file

This article should clear this up for you.


Comment on Re: Problems parsing UTF16 file
Re^2: Problems parsing UTF16 file
by stu23 (Initiate) on Aug 10, 2012 at 08:22 UTC

    thanks for the link to the thread. I have tried to read the file with the two ways shown in the code below. Neither correctly identifies the end of line (cr/lf). The thread explained the layers, but something must be still wrong. I got a suggestion to use file::BOM, but it is not on the shared server I am using and the IT guy does not want to install it. Would that be a forward step on this problem?

    # open (FH_SEGMENT_FILE, '<:crlf:encoding(UTF-16LE):raw', $file_ +segment_name ); open (FH_SEGMENT_FILE, '<:raw:encoding(UTF-16LE):crlf ', $file +_segment_name ); @segment_array=<FH_SEGMENT_FILE>; close(FH_SEGMENT_FILE);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2015-07-03 18:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (55 votes), past polls