in reply to perl read a file on Windows is very strange
This looks as if your file is in UTF-16LE encoding. Use the following to read it:
my $filename = "C:\\TEMP\\PT_TEST_STAT_EXP_export.log"; open my $fh, '<:encoding(UTF-16LE)', $filename or die "Couldn't read '$filename': $! / $^E"; while (<$fh>) { ... };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl read a file on Windows is very strange
by ikegami (Patriarch) on Nov 22, 2010 at 22:40 UTC | |
by perlisfun (Sexton) on Nov 23, 2010 at 17:46 UTC |