in reply to Re^2: Decoding Russian text
in thread Decoding Russian text
You could try different encodings until you find one that works.
This outputs the file decoded using a variety of encodings. It'll be easier to read if file only contains one line.
perl -MEncode -E' binmode(STDIN); binmode(STDOUT, ":encoding(UTF-8)"); $_ = do { local $/; <STDIN> }; for my $enc (Encode->encodings(":all")) { my $dec = eval { decode($enc, $_, Encode::FB_CROAK | Encode::LEAVE_SRC) }; if (defined($dec)) { say "$enc: $dec"; } else { print "$enc: Fail: $@"; } } ' < file
Replace UTF-8 with the encoding your terminal expects.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Decoding Russian text
by vit (Friar) on Jul 13, 2011 at 21:40 UTC | |
by ikegami (Patriarch) on Jul 13, 2011 at 23:00 UTC |