in reply to Problems parsing UTF16 file
Have you tried something like this?
(worked for me)my $file_segment_name = "TestFile1.svd"; open( I, "<:encoding(UTF-16LE)", $file_segment_name ) or die "$file_segment_name: $!"; local $/; $_=<I>; # slurp full file content in one read s/\x{feff}//; # remove BOM @lines = split /\r\n/; print "line #$_ : $lines[$_] (EOL)\n" for ( 0 .. $#lines );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Problems parsing UTF16 file
by stu23 (Initiate) on Aug 10, 2012 at 17:42 UTC | |
by graff (Chancellor) on Aug 11, 2012 at 18:19 UTC | |
by stu23 (Initiate) on Aug 10, 2012 at 17:56 UTC |
In Section
Seekers of Perl Wisdom