Changes some lines,
use it:
import locale if str(locale.getdefaultlocale()[0]).startswith('zh'): _unicode=unicode def unicode(string, encoding='utf8',errors='strict'): try: string.decode('utf8').encode('iso8859-1') except: return _unicode(string) string = string.decode('utf8').encode('iso8859-1') for enc in ('utf8', 'gb2312', 'big5', 'gb18030', 'big5hkscs', 'euc-jp', 'euc_kr', 'cp1251', 'utf16'): try: return string.decode(enc) except: pass return string
Changes some lines,
use it:
import locale getdefaultlocal e()[0]) .startswith( 'zh'): unicode 'utf8', errors= 'strict' ):
string. decode( 'utf8') .encode( 'iso8859- 1') decode( 'utf8') .encode( 'iso8859- 1')
return string.decode(enc)
pass
if str(locale.
_unicode=
def unicode(string, encoding=
try:
except:
return _unicode(string)
string = string.
for enc in ('utf8', 'gb2312', 'big5', 'gb18030', 'big5hkscs', 'euc-jp', 'euc_kr', 'cp1251', 'utf16'):
try:
except:
return string