The problem with guessing character encoding is pretty impossible to solve accurately. It's easy to tell the difference between any of the /UTF-\d\d?/ encodings and ASCII, and it's still pretty easy to tell the difference between ASCII and an 8-bit character set or 8-bit character set and /UTF-\d\d?/. Problems begin when you have 8-bit encoded data and you try to guess which one of the dozens of 8-bit encodings it is.
For example, the ISO-8859 series contains no less than fifteen different encodings, plus all old IBM/Microsoft code pages (CP850, CP437; remember DOS?), encodings used by Windows (such as CP-1252), and so on, not to even mention Asian and East European encodings! In a word: good luck.
(I think Shift JIS is also easy to differentiate from ASCII and UTF, but I have no experience with it. It's 8-bit, but uses two bytes for non-ASCII characters.)
--
print "Just Another Perl Adept\n";
In reply to Re: Encoding issue
by vrk
in thread Encoding issue
by deepakdjadhav
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |