in reply to CSV nightmare
open(my $data, '<:encoding(UCS-2le)', $file)
Actually, due to problems with the placement of the :crlf layer,
open(my $data, '<:raw:encoding(UCS-2le):crlf:utf8', $file)
And the funny char is the BOM (U+FEFF).
read($data, my $bom='', 1); # Discard BOM.
(To the best of my knowledge, what Microsoft uses is not really UTF-16 but UCS-2le.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CSV nightmare
by graff (Chancellor) on Jun 03, 2008 at 02:49 UTC | |
by ikegami (Patriarch) on Jun 03, 2008 at 03:18 UTC |