<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def text_to_data(self, text, elt, ps):
        '''convert text into typecode specific data.
        Encode all strings as UTF-8, which will be type 'str'
        not 'unicode'
        '''
        if self.strip: text = text.strip()
        if self.pyclass is not None:
            return self.pyclass(text.encode(UNICODE_ENCODING))
        return text.encode(UNICODE_ENCODING)