#NEWLINE# def ustr( s , encoding = 'utf-8' ) : #NEWLINE# #INDENT# ' Convert argument to unicode string.\n        ' #NEWLINE# if isinstance ( s , str ) : #NEWLINE# #INDENT# return encoding #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return s . decode ( encoding ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# return str ( s )