#NEWLINE# @ staticmethod #NEWLINE# def serialize( var , protocol_version ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return var . encode ( 'ascii' ) #NEWLINE# #UNINDENT# except UnicodeDecodeError : #NEWLINE# #INDENT# return var