# -*- coding: cp936 -*- CODEPAGE = 'cp936' # # 输入ANSI串,返回Unicode串。该函数可以将'\xBA\xBA\xD7\xD6'转成'\x49\x6C\x57\x5B'。 # def AnsiToUnicode ( sth ) : return( sth.decode( CODEPAGE ).encode( 'unicode_internal' ) ) # # end of AnsiToUnicode #