def _process_text(text, _infile_extension):
    """Process extracted text and return it as a simple string."""
    text = text.decode('utf-8')
    if _infile_extension == '.pdf' or _infile_extension == 'pdf':
        text = text.strip()
    return text
