Handle the very famous decoding - encoding errors in Python !
Python package for cleaning text, Handle Decoding and Encoding errors for all formats.
Place bad text in a file and read it in python source and clean it using textclean.clean() function.
from textclean.textclean import textclean
text = open(“badtext.txt”).read()
cleaned_text = textclean.clean(text)
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.