import re

def cleanString(self, s):
    if isinstance(s, str):
        s = str(s, 'iso-8859-1', 'replace')
s = unicodedata.normalize('NFD', s)
s = re.sub('[^\\x20-\\x7f]+', '', s)
return str(s)
Delete ^L character in a log file