in reply to How to Determine a File's Character Code
You can of course only guess what the proper encoding is...
One way to guess would be to open the file with different encodings and print the result, the one the "looks right" is probably the right one.
In perl you can supply the encoding to use to the open, so this approach could work:
use strict; use Encode; my @encodings = Encode->encodings; for my $encoding (@encodings) { open(my $fh, "<:encoding($encoding)", "C:/EDK") or die $!; my $content = do { local $/; <$fh>; }; print "encoding: $encoding:\n$content\n"; }
|
|---|