#NEWLINE# def uni( s , encoding = None ) : #NEWLINE# #INDENT# if ( not isinstance ( s , unicode ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return unicode ( s , encoding ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return unicode ( s , 'utf-8' ) #NEWLINE# #UNINDENT# except UnicodeDecodeError : #NEWLINE# #INDENT# return unicode ( s , 'latin-1' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return s