#NEWLINE# def encode( self , text ) : #NEWLINE# #INDENT# 'Helper to handle server-specific text encoding.' #NEWLINE# normalized_text = '' . join ( ( self . _normalize_char ( char ) for char in text ) ) #NEWLINE# return normalized_text . encode ( self . charset )