Character encoding auto-detection in Python. As smart as your browser. Open source. >>> import urllib >>> urlread = lambda url: urllib.urlopen(url).read() >>> import chardet >>> chardet.detect(urlread("http://google.cn/")) {'encoding': 'GB2312', 'confidence': 0.99} >>> chardet.detect(urlread("http://yahoo.co.jp/")) {'encoding': 'EUC-JP', 'confidence': 0.99} >>> chardet.detect(urlread("http://amazo