For what I understand, given a sequence of bytes without any further information, it's not generally possible to understand which encoding we are talking about. Of course we can guess (e.g. perl's
Encode::Guess and similar tools), but sometimes this is just not feasible.
In my case, I've got a byte array which is
\xe2\x80\xa1, and I can guess from the context (as a human) that it should correspond either to a
à character (
\xc3\xa0 in UTF-8) or to a
\xc3\xa1 in UTF-8). It comes from an xml which declares iso8859-1 in the header, and is produced by a third party tool, which is clearly broken, but I have to deal with it. As you can guess the decoding fails, and no luck with
How would you face this kind of problem? I know there's no silver bullet, but is there a tool which outstands the others?