Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smart way to find out string encoding?

I wonder whether it is possible to find what is the encoding of string? I know that it may be impossible for some strings (e.g. that do not have non-ASCII characters). Maybe it is possible to obtain a list of encodings that may be correct (possible) for a given string?

I'm looking for some other way than trying to decode/encode and wait for an exception.

like image 343
Maciej Kucharz Avatar asked Aug 31 '10 12:08

Maciej Kucharz


Video Answer


1 Answers

Chardet does a educated guess. Read the FAQ before you use it!

like image 183
Jochen Ritzel Avatar answered Oct 14 '22 01:10

Jochen Ritzel