in reply to Re^2: What's the best way to detect character encodings, Windows-1252 v. UTF-8?
in thread What's the best way to detect character encodings, Windows-1252 v. UTF-8?
andopen(my $fh, '<:raw:perlio', $qfn)
would do, but then you'd have to do CRLF translation.open(my $fh, '<', $qfn) binmode($fh);
will actually work and properly do the CRLF translation (unless you set some default layers somewhere) despite decoding and CRLF translation being done in the wrong order. Note thatopen(my $fh, '<', $qfn)
also decodes and does CRLF translation in the wrong order. That's whyopen(my $fh, '<:encoding(UTF-8)', $qfn)
doesn't work on Windows (of all places!).open(my $fh, '<:encoding(UTF-16le)', $qfn)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: What's the best way to detect character encodings, Windows-1252 v. UTF-8?
by Jim (Curate) on Jun 17, 2011 at 16:38 UTC | |
by ikegami (Patriarch) on Jun 17, 2011 at 18:55 UTC |