This question has already been answered:

There is a certain string, it needs to be translated into a certain encoding, but for this you need to know what encoding it is in now.

Is there such a possibility? It is enough just to display the string encoding.

Reported as a duplicate by Timofei Bondarev , artoodetoo , Visman , gecube , Alexander Soloshenko on Sep 3, '15 at 1:27 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

1 answer 1

In general, no. This is a difficult task - it is necessary to sort out, look how plausible words are obtained ...

I did not manage to find something quickly, except for the IMultiLanguage2 :: DetectCodepageInIStream method , but I think there will be some library.

See also How can I programmatically determine the current default codepage of Windows , can this be your case?

Upd: a, no, there is something for Perl: a cannon