#NEWLINE# def encode( self , value ) : #NEWLINE# #INDENT# if ( not isinstance ( value , self . string_type ) ) : #NEWLINE# #INDENT# raise TypeError ( ( 'expected a unicode string, not ' + repr ( value ) ) ) #NEWLINE# #UNINDENT# return value . encode ( 'utf-8' )