#NEWLINE# def to_utf( v ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return v . strftime ( '%m/%d/%Y %H:%M' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# if isinstance ( v , unicode ) : #NEWLINE# #INDENT# s = v . encode ( 'utf-8' , errors = 'ignore' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( v , basestring ) : #NEWLINE# #INDENT# s = unicode ( v , 'utf-8' , errors = 'ignore' ) . encode ( 'utf-8' , errors = 'ignore' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# s = str ( v ) #NEWLINE# #UNINDENT# #UNINDENT# return s