3 ms·It's not easy! Go check out the source for chardet (Python). It's not pretty.by bastawhiz 3y agoIt's not easy! Go check out the source for chardet (Python). It's not pretty.