Smart way to learn string coding?

I wonder if it is possible to find what string encoding is? I know this may not be possible for some lines (for example, they don't have non-ASCII characters). Maybe it is possible to get a list of encodings that may be correct (possible) for a given string?

I am looking for a different way than trying to decode / encode and wait for the exception.

+7
python encoding character-encoding
source share
1 answer

Chardet gives a reasonable guess. Read the FAQ before using it!

+15
source share

All Articles